hackmate-cli 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +420 -0
- package/dist/api.d.ts +3 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +14 -0
- package/dist/api.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +172 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/ComingSoon.d.ts +7 -0
- package/dist/commands/ComingSoon.d.ts.map +1 -0
- package/dist/commands/ComingSoon.js +4 -0
- package/dist/commands/ComingSoon.js.map +1 -0
- package/dist/commands/Config.d.ts +8 -0
- package/dist/commands/Config.d.ts.map +1 -0
- package/dist/commands/Config.js +42 -0
- package/dist/commands/Config.js.map +1 -0
- package/dist/commands/DataExport.d.ts +2 -0
- package/dist/commands/DataExport.d.ts.map +1 -0
- package/dist/commands/DataExport.js +49 -0
- package/dist/commands/DataExport.js.map +1 -0
- package/dist/commands/Discover.d.ts +2 -0
- package/dist/commands/Discover.d.ts.map +1 -0
- package/dist/commands/Discover.js +93 -0
- package/dist/commands/Discover.js.map +1 -0
- package/dist/commands/MatchList.d.ts +2 -0
- package/dist/commands/MatchList.d.ts.map +1 -0
- package/dist/commands/MatchList.js +118 -0
- package/dist/commands/MatchList.js.map +1 -0
- package/dist/commands/Presence.d.ts +7 -0
- package/dist/commands/Presence.d.ts.map +1 -0
- package/dist/commands/Presence.js +52 -0
- package/dist/commands/Presence.js.map +1 -0
- package/dist/commands/Privacy.d.ts +2 -0
- package/dist/commands/Privacy.d.ts.map +1 -0
- package/dist/commands/Privacy.js +38 -0
- package/dist/commands/Privacy.js.map +1 -0
- package/dist/commands/Settings.d.ts +2 -0
- package/dist/commands/Settings.d.ts.map +1 -0
- package/dist/commands/Settings.js +38 -0
- package/dist/commands/Settings.js.map +1 -0
- package/dist/commands/Stats.d.ts +2 -0
- package/dist/commands/Stats.d.ts.map +1 -0
- package/dist/commands/Stats.js +38 -0
- package/dist/commands/Stats.js.map +1 -0
- package/dist/commands/admin/admin.logic.d.ts +12 -0
- package/dist/commands/admin/admin.logic.d.ts.map +1 -0
- package/dist/commands/admin/admin.logic.js +41 -0
- package/dist/commands/admin/admin.logic.js.map +1 -0
- package/dist/commands/admin/admin.screen.d.ts +10 -0
- package/dist/commands/admin/admin.screen.d.ts.map +1 -0
- package/dist/commands/admin/admin.screen.js +19 -0
- package/dist/commands/admin/admin.screen.js.map +1 -0
- package/dist/commands/admin/index.d.ts +8 -0
- package/dist/commands/admin/index.d.ts.map +1 -0
- package/dist/commands/admin/index.js +8 -0
- package/dist/commands/admin/index.js.map +1 -0
- package/dist/commands/auth/Logout.d.ts +2 -0
- package/dist/commands/auth/Logout.d.ts.map +1 -0
- package/dist/commands/auth/Logout.js +15 -0
- package/dist/commands/auth/Logout.js.map +1 -0
- package/dist/commands/auth/Verify.d.ts +2 -0
- package/dist/commands/auth/Verify.d.ts.map +1 -0
- package/dist/commands/auth/Verify.js +16 -0
- package/dist/commands/auth/Verify.js.map +1 -0
- package/dist/commands/auth/auth.logic.d.ts +31 -0
- package/dist/commands/auth/auth.logic.d.ts.map +1 -0
- package/dist/commands/auth/auth.logic.js +147 -0
- package/dist/commands/auth/auth.logic.js.map +1 -0
- package/dist/commands/auth/index.d.ts +3 -0
- package/dist/commands/auth/index.d.ts.map +1 -0
- package/dist/commands/auth/index.js +17 -0
- package/dist/commands/auth/index.js.map +1 -0
- package/dist/commands/auth/login.screen.d.ts +15 -0
- package/dist/commands/auth/login.screen.d.ts.map +1 -0
- package/dist/commands/auth/login.screen.js +10 -0
- package/dist/commands/auth/login.screen.js.map +1 -0
- package/dist/commands/auth/signup.screen.d.ts +23 -0
- package/dist/commands/auth/signup.screen.d.ts.map +1 -0
- package/dist/commands/auth/signup.screen.js +13 -0
- package/dist/commands/auth/signup.screen.js.map +1 -0
- package/dist/commands/auth/verify.logic.d.ts +11 -0
- package/dist/commands/auth/verify.logic.d.ts.map +1 -0
- package/dist/commands/auth/verify.logic.js +56 -0
- package/dist/commands/auth/verify.logic.js.map +1 -0
- package/dist/commands/chat/ChatList.d.ts +2 -0
- package/dist/commands/chat/ChatList.d.ts.map +1 -0
- package/dist/commands/chat/ChatList.js +63 -0
- package/dist/commands/chat/ChatList.js.map +1 -0
- package/dist/commands/chat/chat.logic.d.ts +15 -0
- package/dist/commands/chat/chat.logic.d.ts.map +1 -0
- package/dist/commands/chat/chat.logic.js +139 -0
- package/dist/commands/chat/chat.logic.js.map +1 -0
- package/dist/commands/chat/chat.screen.d.ts +12 -0
- package/dist/commands/chat/chat.screen.d.ts.map +1 -0
- package/dist/commands/chat/chat.screen.js +12 -0
- package/dist/commands/chat/chat.screen.js.map +1 -0
- package/dist/commands/chat/index.d.ts +8 -0
- package/dist/commands/chat/index.d.ts.map +1 -0
- package/dist/commands/chat/index.js +9 -0
- package/dist/commands/chat/index.js.map +1 -0
- package/dist/commands/group/group.logic.d.ts +26 -0
- package/dist/commands/group/group.logic.d.ts.map +1 -0
- package/dist/commands/group/group.logic.js +73 -0
- package/dist/commands/group/group.logic.js.map +1 -0
- package/dist/commands/group/group.screen.d.ts +19 -0
- package/dist/commands/group/group.screen.d.ts.map +1 -0
- package/dist/commands/group/group.screen.js +22 -0
- package/dist/commands/group/group.screen.js.map +1 -0
- package/dist/commands/group/index.d.ts +9 -0
- package/dist/commands/group/index.d.ts.map +1 -0
- package/dist/commands/group/index.js +8 -0
- package/dist/commands/group/index.js.map +1 -0
- package/dist/commands/network/index.d.ts +8 -0
- package/dist/commands/network/index.d.ts.map +1 -0
- package/dist/commands/network/index.js +8 -0
- package/dist/commands/network/index.js.map +1 -0
- package/dist/commands/network/network.logic.d.ts +12 -0
- package/dist/commands/network/network.logic.d.ts.map +1 -0
- package/dist/commands/network/network.logic.js +69 -0
- package/dist/commands/network/network.logic.js.map +1 -0
- package/dist/commands/network/network.screen.d.ts +10 -0
- package/dist/commands/network/network.screen.d.ts.map +1 -0
- package/dist/commands/network/network.screen.js +17 -0
- package/dist/commands/network/network.screen.js.map +1 -0
- package/dist/commands/notification/index.d.ts +7 -0
- package/dist/commands/notification/index.d.ts.map +1 -0
- package/dist/commands/notification/index.js +8 -0
- package/dist/commands/notification/index.js.map +1 -0
- package/dist/commands/notification/notification.logic.d.ts +11 -0
- package/dist/commands/notification/notification.logic.d.ts.map +1 -0
- package/dist/commands/notification/notification.logic.js +33 -0
- package/dist/commands/notification/notification.logic.js.map +1 -0
- package/dist/commands/notification/notification.screen.d.ts +10 -0
- package/dist/commands/notification/notification.screen.d.ts.map +1 -0
- package/dist/commands/notification/notification.screen.js +13 -0
- package/dist/commands/notification/notification.screen.js.map +1 -0
- package/dist/commands/profile/index.d.ts +6 -0
- package/dist/commands/profile/index.d.ts.map +1 -0
- package/dist/commands/profile/index.js +14 -0
- package/dist/commands/profile/index.js.map +1 -0
- package/dist/commands/profile/profile-edit.screen.d.ts +12 -0
- package/dist/commands/profile/profile-edit.screen.d.ts.map +1 -0
- package/dist/commands/profile/profile-edit.screen.js +66 -0
- package/dist/commands/profile/profile-edit.screen.js.map +1 -0
- package/dist/commands/profile/profile-view.screen.d.ts +10 -0
- package/dist/commands/profile/profile-view.screen.d.ts.map +1 -0
- package/dist/commands/profile/profile-view.screen.js +12 -0
- package/dist/commands/profile/profile-view.screen.js.map +1 -0
- package/dist/commands/profile/profile.logic.d.ts +42 -0
- package/dist/commands/profile/profile.logic.d.ts.map +1 -0
- package/dist/commands/profile/profile.logic.js +74 -0
- package/dist/commands/profile/profile.logic.js.map +1 -0
- package/dist/commands/project/index.d.ts +9 -0
- package/dist/commands/project/index.d.ts.map +1 -0
- package/dist/commands/project/index.js +8 -0
- package/dist/commands/project/index.js.map +1 -0
- package/dist/commands/project/project.logic.d.ts +29 -0
- package/dist/commands/project/project.logic.d.ts.map +1 -0
- package/dist/commands/project/project.logic.js +92 -0
- package/dist/commands/project/project.logic.js.map +1 -0
- package/dist/commands/project/project.screen.d.ts +22 -0
- package/dist/commands/project/project.screen.d.ts.map +1 -0
- package/dist/commands/project/project.screen.js +27 -0
- package/dist/commands/project/project.screen.js.map +1 -0
- package/dist/commands/stubs/index.d.ts +9 -0
- package/dist/commands/stubs/index.d.ts.map +1 -0
- package/dist/commands/stubs/index.js +24 -0
- package/dist/commands/stubs/index.js.map +1 -0
- package/dist/config.d.ts +14 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +29 -0
- package/dist/config.js.map +1 -0
- package/dist/context/AuthContext.d.ts +18 -0
- package/dist/context/AuthContext.d.ts.map +1 -0
- package/dist/context/AuthContext.js +49 -0
- package/dist/context/AuthContext.js.map +1 -0
- package/dist/context/SocketContext.d.ts +12 -0
- package/dist/context/SocketContext.d.ts.map +1 -0
- package/dist/context/SocketContext.js +44 -0
- package/dist/context/SocketContext.js.map +1 -0
- package/dist/context/index.d.ts +7 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +9 -0
- package/dist/context/index.js.map +1 -0
- package/dist/features/admin/components/admin.screen.d.ts +10 -0
- package/dist/features/admin/components/admin.screen.d.ts.map +1 -0
- package/dist/features/admin/components/admin.screen.js +19 -0
- package/dist/features/admin/components/admin.screen.js.map +1 -0
- package/dist/features/admin/components/index.d.ts +8 -0
- package/dist/features/admin/components/index.d.ts.map +1 -0
- package/dist/features/admin/components/index.js +8 -0
- package/dist/features/admin/components/index.js.map +1 -0
- package/dist/features/admin/hooks/useAdmin.d.ts +12 -0
- package/dist/features/admin/hooks/useAdmin.d.ts.map +1 -0
- package/dist/features/admin/hooks/useAdmin.js +46 -0
- package/dist/features/admin/hooks/useAdmin.js.map +1 -0
- package/dist/features/admin/index.d.ts +3 -0
- package/dist/features/admin/index.d.ts.map +1 -0
- package/dist/features/admin/index.js +3 -0
- package/dist/features/admin/index.js.map +1 -0
- package/dist/features/chat/components/ChatList.d.ts +2 -0
- package/dist/features/chat/components/ChatList.d.ts.map +1 -0
- package/dist/features/chat/components/ChatList.js +63 -0
- package/dist/features/chat/components/ChatList.js.map +1 -0
- package/dist/features/chat/components/chat.screen.d.ts +12 -0
- package/dist/features/chat/components/chat.screen.d.ts.map +1 -0
- package/dist/features/chat/components/chat.screen.js +12 -0
- package/dist/features/chat/components/chat.screen.js.map +1 -0
- package/dist/features/chat/components/index.d.ts +9 -0
- package/dist/features/chat/components/index.d.ts.map +1 -0
- package/dist/features/chat/components/index.js +9 -0
- package/dist/features/chat/components/index.js.map +1 -0
- package/dist/features/chat/hooks/useChat.d.ts +15 -0
- package/dist/features/chat/hooks/useChat.d.ts.map +1 -0
- package/dist/features/chat/hooks/useChat.js +150 -0
- package/dist/features/chat/hooks/useChat.js.map +1 -0
- package/dist/features/chat/index.d.ts +4 -0
- package/dist/features/chat/index.d.ts.map +1 -0
- package/dist/features/chat/index.js +4 -0
- package/dist/features/chat/index.js.map +1 -0
- package/dist/features/group/components/group.screen.d.ts +19 -0
- package/dist/features/group/components/group.screen.d.ts.map +1 -0
- package/dist/features/group/components/group.screen.js +22 -0
- package/dist/features/group/components/group.screen.js.map +1 -0
- package/dist/features/group/components/index.d.ts +9 -0
- package/dist/features/group/components/index.d.ts.map +1 -0
- package/dist/features/group/components/index.js +8 -0
- package/dist/features/group/components/index.js.map +1 -0
- package/dist/features/group/hooks/useGroup.d.ts +26 -0
- package/dist/features/group/hooks/useGroup.d.ts.map +1 -0
- package/dist/features/group/hooks/useGroup.js +78 -0
- package/dist/features/group/hooks/useGroup.js.map +1 -0
- package/dist/features/group/index.d.ts +3 -0
- package/dist/features/group/index.d.ts.map +1 -0
- package/dist/features/group/index.js +3 -0
- package/dist/features/group/index.js.map +1 -0
- package/dist/features/network/components/UnfriendByUsername.d.ts +7 -0
- package/dist/features/network/components/UnfriendByUsername.d.ts.map +1 -0
- package/dist/features/network/components/UnfriendByUsername.js +40 -0
- package/dist/features/network/components/UnfriendByUsername.js.map +1 -0
- package/dist/features/network/components/index.d.ts +8 -0
- package/dist/features/network/components/index.d.ts.map +1 -0
- package/dist/features/network/components/index.js +9 -0
- package/dist/features/network/components/index.js.map +1 -0
- package/dist/features/network/components/network.screen.d.ts +10 -0
- package/dist/features/network/components/network.screen.d.ts.map +1 -0
- package/dist/features/network/components/network.screen.js +17 -0
- package/dist/features/network/components/network.screen.js.map +1 -0
- package/dist/features/network/hooks/useNetwork.d.ts +12 -0
- package/dist/features/network/hooks/useNetwork.d.ts.map +1 -0
- package/dist/features/network/hooks/useNetwork.js +74 -0
- package/dist/features/network/hooks/useNetwork.js.map +1 -0
- package/dist/features/network/hooks/useUnfriend.d.ts +7 -0
- package/dist/features/network/hooks/useUnfriend.d.ts.map +1 -0
- package/dist/features/network/hooks/useUnfriend.js +24 -0
- package/dist/features/network/hooks/useUnfriend.js.map +1 -0
- package/dist/features/network/index.d.ts +4 -0
- package/dist/features/network/index.d.ts.map +1 -0
- package/dist/features/network/index.js +4 -0
- package/dist/features/network/index.js.map +1 -0
- package/dist/features/notification/components/index.d.ts +7 -0
- package/dist/features/notification/components/index.d.ts.map +1 -0
- package/dist/features/notification/components/index.js +8 -0
- package/dist/features/notification/components/index.js.map +1 -0
- package/dist/features/notification/components/notification.screen.d.ts +10 -0
- package/dist/features/notification/components/notification.screen.d.ts.map +1 -0
- package/dist/features/notification/components/notification.screen.js +13 -0
- package/dist/features/notification/components/notification.screen.js.map +1 -0
- package/dist/features/notification/hooks/useNotification.d.ts +11 -0
- package/dist/features/notification/hooks/useNotification.d.ts.map +1 -0
- package/dist/features/notification/hooks/useNotification.js +38 -0
- package/dist/features/notification/hooks/useNotification.js.map +1 -0
- package/dist/features/notification/index.d.ts +3 -0
- package/dist/features/notification/index.d.ts.map +1 -0
- package/dist/features/notification/index.js +3 -0
- package/dist/features/notification/index.js.map +1 -0
- package/dist/features/profile/components/index.d.ts +6 -0
- package/dist/features/profile/components/index.d.ts.map +1 -0
- package/dist/features/profile/components/index.js +13 -0
- package/dist/features/profile/components/index.js.map +1 -0
- package/dist/features/profile/components/profile-edit.screen.d.ts +14 -0
- package/dist/features/profile/components/profile-edit.screen.d.ts.map +1 -0
- package/dist/features/profile/components/profile-edit.screen.js +182 -0
- package/dist/features/profile/components/profile-edit.screen.js.map +1 -0
- package/dist/features/profile/components/profile-view.screen.d.ts +10 -0
- package/dist/features/profile/components/profile-view.screen.d.ts.map +1 -0
- package/dist/features/profile/components/profile-view.screen.js +13 -0
- package/dist/features/profile/components/profile-view.screen.js.map +1 -0
- package/dist/features/profile/hooks/useProfile.d.ts +17 -0
- package/dist/features/profile/hooks/useProfile.d.ts.map +1 -0
- package/dist/features/profile/hooks/useProfile.js +148 -0
- package/dist/features/profile/hooks/useProfile.js.map +1 -0
- package/dist/features/profile/index.d.ts +3 -0
- package/dist/features/profile/index.d.ts.map +1 -0
- package/dist/features/profile/index.js +3 -0
- package/dist/features/profile/index.js.map +1 -0
- package/dist/features/project/components/index.d.ts +9 -0
- package/dist/features/project/components/index.d.ts.map +1 -0
- package/dist/features/project/components/index.js +8 -0
- package/dist/features/project/components/index.js.map +1 -0
- package/dist/features/project/components/project.screen.d.ts +22 -0
- package/dist/features/project/components/project.screen.d.ts.map +1 -0
- package/dist/features/project/components/project.screen.js +27 -0
- package/dist/features/project/components/project.screen.js.map +1 -0
- package/dist/features/project/hooks/useProject.d.ts +29 -0
- package/dist/features/project/hooks/useProject.d.ts.map +1 -0
- package/dist/features/project/hooks/useProject.js +97 -0
- package/dist/features/project/hooks/useProject.js.map +1 -0
- package/dist/features/project/index.d.ts +3 -0
- package/dist/features/project/index.d.ts.map +1 -0
- package/dist/features/project/index.js +3 -0
- package/dist/features/project/index.js.map +1 -0
- package/package.json +58 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ProjectScreenProps {
|
|
3
|
+
action: string;
|
|
4
|
+
data: any;
|
|
5
|
+
error: string | null;
|
|
6
|
+
loading: boolean;
|
|
7
|
+
formStep: number;
|
|
8
|
+
setFormStep: (step: number) => void;
|
|
9
|
+
formData: {
|
|
10
|
+
title: string;
|
|
11
|
+
description: string;
|
|
12
|
+
skills: string;
|
|
13
|
+
};
|
|
14
|
+
setFormData: (data: any) => void;
|
|
15
|
+
message: string;
|
|
16
|
+
setMessage: (msg: string) => void;
|
|
17
|
+
handleCreateSubmit: () => void;
|
|
18
|
+
handleApplySubmit: () => void;
|
|
19
|
+
}
|
|
20
|
+
export declare const ProjectScreen: React.FC<ProjectScreenProps>;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=project.screen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.screen.d.ts","sourceRoot":"","sources":["../../../src/commands/project/project.screen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,kBAAkB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,GAAG,CAAC;IACV,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACjE,WAAW,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,iBAAiB,EAAE,MAAM,IAAI,CAAC;CACjC;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAiGtD,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Text, Box } from 'ink';
|
|
3
|
+
import TextInput from 'ink-text-input';
|
|
4
|
+
export const ProjectScreen = ({ action, data, error, loading, formStep, setFormStep, formData, setFormData, message, setMessage, handleCreateSubmit, handleApplySubmit }) => {
|
|
5
|
+
if (loading)
|
|
6
|
+
return _jsx(Text, { children: "Loading..." });
|
|
7
|
+
if (error)
|
|
8
|
+
return _jsxs(Text, { color: "red", children: ["Error: ", error] });
|
|
9
|
+
if (action === 'list') {
|
|
10
|
+
return (_jsxs(Box, { flexDirection: "column", padding: 1, borderStyle: "round", borderColor: "magenta", children: [_jsx(Text, { bold: true, children: "\uD83D\uDD25 Open Projects" }), Array.isArray(data) && data.length === 0 && _jsx(Text, { italic: true, color: "gray", children: "No open projects." }), Array.isArray(data) && data.map((p) => (_jsxs(Box, { flexDirection: "column", marginY: 1, children: [_jsxs(Text, { bold: true, color: "cyan", children: [p.title, " ", _jsxs(Text, { color: "gray", children: ["(ID: ", p._id, ")"] })] }), _jsxs(Text, { color: "green", children: ["By @", p.ownerId?.username] }), _jsxs(Text, { children: [p.description.substring(0, 100), "..."] }), _jsxs(Text, { color: "blue", children: ["Skills: ", p.skills?.join(', ')] })] }, p._id)))] }));
|
|
11
|
+
}
|
|
12
|
+
if (action === 'view') {
|
|
13
|
+
return (_jsxs(Box, { flexDirection: "column", padding: 1, borderStyle: "round", borderColor: "cyan", children: [_jsx(Text, { bold: true, color: "magenta", children: data.title }), _jsxs(Text, { color: "gray", children: ["Started by @", data.ownerId?.username] }), _jsx(Box, { marginY: 1, children: _jsx(Text, { children: data.description }) }), _jsxs(Text, { bold: true, children: ["Skills required: ", _jsx(Text, { color: "blue", children: data.skills?.join(', ') })] }), _jsx(Box, { marginY: 1, children: _jsx(Text, { children: "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500" }) }), _jsxs(Text, { bold: true, children: ["Applicants (", data.applicants?.length || 0, "):"] }), data.applicants?.map((a) => (_jsxs(Text, { children: ["\u2022 ", a.userId.username, " [", a.status, "] - \"", a.message, "\"", _jsxs(Text, { color: "gray", children: [" (ID: ", a.userId._id, ")"] })] }, a.userId._id)))] }));
|
|
14
|
+
}
|
|
15
|
+
if (action === 'create') {
|
|
16
|
+
if (data?.message)
|
|
17
|
+
return _jsxs(Text, { color: "green", children: ["\u2705 ", data.message] });
|
|
18
|
+
return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsx(Text, { bold: true, children: "Create New Project" }), formStep === 0 && (_jsxs(Box, { children: [_jsx(Text, { children: "Title: " }), _jsx(TextInput, { value: formData.title, onChange: v => setFormData({ ...formData, title: v }), onSubmit: () => setFormStep(1) })] })), formStep === 1 && (_jsxs(Box, { children: [_jsx(Text, { children: "Description: " }), _jsx(TextInput, { value: formData.description, onChange: v => setFormData({ ...formData, description: v }), onSubmit: () => setFormStep(2) })] })), formStep === 2 && (_jsxs(Box, { children: [_jsx(Text, { children: "Skills (comma sep): " }), _jsx(TextInput, { value: formData.skills, onChange: v => setFormData({ ...formData, skills: v }), onSubmit: handleCreateSubmit })] }))] }));
|
|
19
|
+
}
|
|
20
|
+
if (action === 'apply') {
|
|
21
|
+
if (data?.message)
|
|
22
|
+
return _jsxs(Text, { color: "green", children: ["\u2705 ", data.message] });
|
|
23
|
+
return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsx(Text, { bold: true, children: "Apply to Project" }), _jsx(Text, { children: "Message to owner: " }), _jsx(TextInput, { value: message, onChange: setMessage, onSubmit: handleApplySubmit })] }));
|
|
24
|
+
}
|
|
25
|
+
return _jsxs(Text, { color: "green", children: ["\u2705 ", data?.message] });
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=project.screen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.screen.js","sourceRoot":"","sources":["../../../src/commands/project/project.screen.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AA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,CACT,IACC,CACT,CAAC;IACN,CAAC;IAED,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;QACrB,IAAI,IAAI,EAAE,OAAO;YAAE,OAAO,MAAC,IAAI,IAAC,KAAK,EAAC,OAAO,wBAAI,IAAI,CAAC,OAAO,IAAQ,CAAC;QACtE,OAAO,CACH,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,OAAO,EAAE,CAAC,aAClC,KAAC,IAAI,IAAC,IAAI,uCAAwB,EAClC,KAAC,IAAI,qCAA0B,EAC/B,KAAC,SAAS,IAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,iBAAiB,GAAI,IAC9E,CACT,CAAC;IACN,CAAC;IAED,OAAO,MAAC,IAAI,IAAC,KAAK,EAAC,OAAO,wBAAI,IAAI,EAAE,OAAO,IAAQ,CAAC;AACxD,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const StatsStub: () => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const MatchStub: () => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const BotStub: () => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare const ConfigStub: () => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare const DataStub: () => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const PresenceStub: ({ status }: {
|
|
7
|
+
status: string;
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/stubs/index.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,SAAS,+CAQrB,CAAC;AAEF,eAAO,MAAM,SAAS,+CAMrB,CAAC;AAEF,eAAO,MAAM,OAAO,+CAgBnB,CAAC;AAEF,eAAO,MAAM,UAAU,+CAWtB,CAAC;AAEF,eAAO,MAAM,QAAQ,+CAMpB,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,YAAY;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,4CAI1D,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
import { Text, Box } from 'ink';
|
|
4
|
+
import Conf from 'conf';
|
|
5
|
+
const config = new Conf({ projectName: 'hackmate-cli' });
|
|
6
|
+
export const StatsStub = () => (_jsxs(Box, { borderStyle: "round", borderColor: "blue", padding: 1, flexDirection: "column", children: [_jsx(Text, { bold: true, underline: true, children: "\uD83D\uDCCA Your Stats" }), _jsx(Text, { children: "\uD83D\uDD25 Streak: 12 days" }), _jsx(Text, { children: "\uD83D\uDCAC Messages Sent: 1,337" }), _jsx(Text, { children: "\uD83E\uDD1D Profile Views: 42" }), _jsx(Text, { children: "\u2B50 Reputation: 9000+" })] }));
|
|
7
|
+
export const MatchStub = () => (_jsxs(Box, { borderStyle: "round", borderColor: "magenta", padding: 1, flexDirection: "column", children: [_jsx(Text, { bold: true, color: "magenta", children: "\u2764\uFE0F Match Queue" }), _jsx(Text, { children: "No new matches nearby." }), _jsx(Text, { color: "gray", children: "Try updating your filters or location!" })] }));
|
|
8
|
+
export const BotStub = () => {
|
|
9
|
+
const [enabled, setEnabled] = useState(config.get('bot_enabled') || false);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
// Toggle simulated state
|
|
12
|
+
config.set('bot_enabled', !enabled);
|
|
13
|
+
setEnabled(!enabled);
|
|
14
|
+
}, []);
|
|
15
|
+
return (_jsxs(Box, { borderStyle: "round", borderColor: "cyan", padding: 1, flexDirection: "column", children: [_jsx(Text, { bold: true, color: "cyan", children: "\uD83E\uDD16 HackBot Status" }), _jsxs(Text, { children: ["Status: ", enabled ? _jsx(Text, { color: "green", children: "ONLINE" }) : _jsx(Text, { color: "red", children: "OFFLINE" })] }), _jsxs(Text, { dimColor: true, children: ["Bot auto-reply features ", enabled ? 'enabled' : 'disabled', "."] })] }));
|
|
16
|
+
};
|
|
17
|
+
export const ConfigStub = () => {
|
|
18
|
+
const path = config.path;
|
|
19
|
+
const store = config.store;
|
|
20
|
+
return (_jsxs(Box, { borderStyle: "round", borderColor: "white", padding: 1, flexDirection: "column", children: [_jsx(Text, { bold: true, children: "\u2699\uFE0F Configuration" }), _jsxs(Text, { children: ["Path: ", path] }), _jsx(Text, { children: "Values:" }), _jsx(Text, { color: "gray", children: JSON.stringify(store, null, 2) })] }));
|
|
21
|
+
};
|
|
22
|
+
export const DataStub = () => (_jsxs(Box, { borderStyle: "round", borderColor: "yellow", padding: 1, flexDirection: "column", children: [_jsx(Text, { bold: true, children: "\uD83D\uDCE6 Data Export" }), _jsx(Text, { children: "Exporting your data to ./hackmate_export.json..." }), _jsx(Text, { color: "green", children: "Done!" })] }));
|
|
23
|
+
export const PresenceStub = ({ status }) => (_jsx(Box, { borderStyle: "round", borderColor: "green", padding: 1, children: _jsxs(Text, { children: ["Updating presence to: ", _jsx(Text, { bold: true, color: status === 'online' ? 'green' : 'gray', children: status.toUpperCase() })] }) }));
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/stubs/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,GAAG,EAAU,MAAM,KAAK,CAAC;AACxC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC,CAAC;AAEzD,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,CAC3B,MAAC,GAAG,IAAC,WAAW,EAAC,OA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C,IAAI,IAAC,IAAI,QAAC,KAAK,EAAE,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,YAAG,MAAM,CAAC,WAAW,EAAE,GAAQ,IAAO,GACxH,CACT,CAAC"}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const saveToken: (token: string) => void;
|
|
2
|
+
export declare const getToken: () => string | undefined;
|
|
3
|
+
export declare const saveUser: (user: {
|
|
4
|
+
username: string;
|
|
5
|
+
id: string;
|
|
6
|
+
}) => void;
|
|
7
|
+
export declare const getUser: () => {
|
|
8
|
+
username: string;
|
|
9
|
+
id: string;
|
|
10
|
+
} | undefined;
|
|
11
|
+
export declare const getApiUrl: () => string;
|
|
12
|
+
export declare const setApiUrl: (url: string) => void;
|
|
13
|
+
export declare const logout: () => void;
|
|
14
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,SAAS,GAAI,OAAO,MAAM,SAEtC,CAAC;AAEF,eAAO,MAAM,QAAQ,0BAEpB,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,MAAM;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,SAE9D,CAAC;AAEF,eAAO,MAAM,OAAO;cAzBF,MAAM;QACZ,MAAM;aA0BjB,CAAC;AAEF,eAAO,MAAM,SAAS,cAGrB,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,KAAK,MAAM,SAEpC,CAAC;AAEF,eAAO,MAAM,MAAM,YAElB,CAAC"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import Conf from 'conf';
|
|
2
|
+
const config = new Conf({
|
|
3
|
+
projectName: 'hackmate-cli',
|
|
4
|
+
});
|
|
5
|
+
// Deployed server default; can be overridden by config or env
|
|
6
|
+
const DEFAULT_API_URL = process.env.DEFAULT_API_URL || 'https://hackmateserver-huhcaec4g7eua0hf.centralindia-01.azurewebsites.net';
|
|
7
|
+
export const saveToken = (token) => {
|
|
8
|
+
config.set('token', token);
|
|
9
|
+
};
|
|
10
|
+
export const getToken = () => {
|
|
11
|
+
return config.get('token');
|
|
12
|
+
};
|
|
13
|
+
export const saveUser = (user) => {
|
|
14
|
+
config.set('user', user);
|
|
15
|
+
};
|
|
16
|
+
export const getUser = () => {
|
|
17
|
+
return config.get('user');
|
|
18
|
+
};
|
|
19
|
+
export const getApiUrl = () => {
|
|
20
|
+
// Priority: 1. Config stored value, 2. Environment variable (API_URL), 3. Default deployed URL
|
|
21
|
+
return config.get('apiUrl') || process.env.API_URL || DEFAULT_API_URL;
|
|
22
|
+
};
|
|
23
|
+
export const setApiUrl = (url) => {
|
|
24
|
+
config.set('apiUrl', url);
|
|
25
|
+
};
|
|
26
|
+
export const logout = () => {
|
|
27
|
+
config.clear();
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAWxB,MAAM,MAAM,GAAG,IAAI,IAAI,CAAS;IAC5B,WAAW,EAAE,cAAc;CAC9B,CAAC,CAAC;AAEH,8DAA8D;AAC9D,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,2EAA2E,CAAC;AAEnI,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,KAAa,EAAE,EAAE;IACvC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AAC/B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,EAAE;IACzB,OAAO,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AAC/B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,IAAsC,EAAE,EAAE;IAC/D,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AAC7B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,EAAE;IACxB,OAAO,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC9B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE;IAC1B,+FAA+F;IAC/F,OAAO,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,eAAe,CAAC;AAC1E,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE,EAAE;IACrC,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;AAC9B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,EAAE;IACvB,MAAM,CAAC,KAAK,EAAE,CAAC;AACnB,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface User {
|
|
3
|
+
username: string;
|
|
4
|
+
id: string;
|
|
5
|
+
}
|
|
6
|
+
export interface AuthContextType {
|
|
7
|
+
user: User | null;
|
|
8
|
+
token: string | null;
|
|
9
|
+
isAuthenticated: boolean;
|
|
10
|
+
login: (token: string, user: User) => void;
|
|
11
|
+
logout: () => void;
|
|
12
|
+
isLoading: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const AuthProvider: React.FC<{
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
}>;
|
|
17
|
+
export declare const useAuth: () => AuthContextType;
|
|
18
|
+
//# sourceMappingURL=AuthContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthContext.d.ts","sourceRoot":"","sources":["../../src/context/AuthContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyD,MAAM,OAAO,CAAC;AAG9E,MAAM,WAAW,IAAI;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,eAAe;IAC5B,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,eAAe,EAAE,OAAO,CAAC;IACzB,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAC3C,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;CACtB;AAID,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CA6ChE,CAAC;AAEF,eAAO,MAAM,OAAO,uBAMnB,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext, useEffect, useState } from 'react';
|
|
3
|
+
import { saveToken, saveUser, getToken, getUser, logout as configLogout } from '../config.js';
|
|
4
|
+
const AuthContext = createContext(undefined);
|
|
5
|
+
export const AuthProvider = ({ children }) => {
|
|
6
|
+
const [user, setUser] = useState(null);
|
|
7
|
+
const [token, setToken] = useState(null);
|
|
8
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
const loadSession = () => {
|
|
11
|
+
const storedUser = getUser();
|
|
12
|
+
const storedToken = getToken();
|
|
13
|
+
if (storedUser && storedToken) {
|
|
14
|
+
// @ts-ignore - Conf types might be slightly off given strict null checks, but this is safe runtime
|
|
15
|
+
setUser(storedUser);
|
|
16
|
+
setToken(storedToken);
|
|
17
|
+
}
|
|
18
|
+
setIsLoading(false);
|
|
19
|
+
};
|
|
20
|
+
loadSession();
|
|
21
|
+
}, []);
|
|
22
|
+
const login = (newToken, newUser) => {
|
|
23
|
+
saveToken(newToken);
|
|
24
|
+
saveUser(newUser);
|
|
25
|
+
setToken(newToken);
|
|
26
|
+
setUser(newUser);
|
|
27
|
+
};
|
|
28
|
+
const logout = () => {
|
|
29
|
+
configLogout();
|
|
30
|
+
setToken(null);
|
|
31
|
+
setUser(null);
|
|
32
|
+
};
|
|
33
|
+
return (_jsx(AuthContext.Provider, { value: {
|
|
34
|
+
user,
|
|
35
|
+
token,
|
|
36
|
+
isAuthenticated: !!user && !!token,
|
|
37
|
+
login,
|
|
38
|
+
logout,
|
|
39
|
+
isLoading
|
|
40
|
+
}, children: children }));
|
|
41
|
+
};
|
|
42
|
+
export const useAuth = () => {
|
|
43
|
+
const context = useContext(AuthContext);
|
|
44
|
+
if (!context) {
|
|
45
|
+
throw new Error('useAuth must be used within an AuthProvider');
|
|
46
|
+
}
|
|
47
|
+
return context;
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=AuthContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthContext.js","sourceRoot":"","sources":["../../src/context/AuthContext.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,cAAc,CAAC;AAgB9F,MAAM,WAAW,GAAG,aAAa,CAA8B,SAAS,CAAC,CAAC;AAE1E,MAAM,CAAC,MAAM,YAAY,GAA4C,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IAClF,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAc,IAAI,CAAC,CAAC;IACpD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GA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C,CAAC;IACxC,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,OAAO,CAAC;AACnB,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Socket } from 'socket.io-client';
|
|
3
|
+
interface SocketContextType {
|
|
4
|
+
socket: Socket | null;
|
|
5
|
+
isConnected: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const SocketProvider: React.FC<{
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const useSocket: () => SocketContextType;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=SocketContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SocketContext.d.ts","sourceRoot":"","sources":["../../src/context/SocketContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyD,MAAM,OAAO,CAAC;AAC9E,OAAO,EAAM,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAG9C,UAAU,iBAAiB;IACvB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;CACxB;AAOD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAuClE,CAAC;AAEF,eAAO,MAAM,SAAS,yBAMrB,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext, useEffect, useState } from 'react';
|
|
3
|
+
import { io } from 'socket.io-client';
|
|
4
|
+
import { useAuth } from './AuthContext.js';
|
|
5
|
+
const SocketContext = createContext(undefined);
|
|
6
|
+
// Hardcoded for now, or move to config/env
|
|
7
|
+
const SOCKET_URL = 'http://localhost:3001';
|
|
8
|
+
export const SocketProvider = ({ children }) => {
|
|
9
|
+
const { token, isAuthenticated } = useAuth();
|
|
10
|
+
const [socket, setSocket] = useState(null);
|
|
11
|
+
const [isConnected, setIsConnected] = useState(false);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
if (!isAuthenticated || !token) {
|
|
14
|
+
if (socket) {
|
|
15
|
+
socket.disconnect();
|
|
16
|
+
setSocket(null);
|
|
17
|
+
setIsConnected(false);
|
|
18
|
+
}
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const newSocket = io(SOCKET_URL, {
|
|
22
|
+
auth: { token: `Bearer ${token}` }
|
|
23
|
+
});
|
|
24
|
+
newSocket.on('connect', () => {
|
|
25
|
+
setIsConnected(true);
|
|
26
|
+
});
|
|
27
|
+
newSocket.on('disconnect', () => {
|
|
28
|
+
setIsConnected(false);
|
|
29
|
+
});
|
|
30
|
+
setSocket(newSocket);
|
|
31
|
+
return () => {
|
|
32
|
+
newSocket.disconnect();
|
|
33
|
+
};
|
|
34
|
+
}, [isAuthenticated, token]);
|
|
35
|
+
return (_jsx(SocketContext.Provider, { value: { socket, isConnected }, children: children }));
|
|
36
|
+
};
|
|
37
|
+
export const useSocket = () => {
|
|
38
|
+
const context = useContext(SocketContext);
|
|
39
|
+
if (!context) {
|
|
40
|
+
throw new Error('useSocket must be used within a SocketProvider');
|
|
41
|
+
}
|
|
42
|
+
return context;
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=SocketContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SocketContext.js","sourceRoot":"","sources":["../../src/context/SocketContext.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9E,OAAO,EAAE,EAAE,EAAU,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAO3C,MAAM,aAAa,GAAG,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KAAK,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,YACjD,QAAQ,GACY,CAC5B,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE;IAC1B,MAAM,OAAO,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC;IAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IACtE,CAAC;IACD,OAAO,OAAO,CAAC;AACnB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/context/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAQ/D,CAAC;AAEF,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { AuthProvider } from './AuthContext.js';
|
|
3
|
+
import { SocketProvider } from './SocketContext.js';
|
|
4
|
+
export const AppProvider = ({ children }) => {
|
|
5
|
+
return (_jsx(AuthProvider, { children: _jsx(SocketProvider, { children: children }) }));
|
|
6
|
+
};
|
|
7
|
+
export * from './AuthContext.js';
|
|
8
|
+
export * from './SocketContext.js';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/context/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,CAAC,MAAM,WAAW,GAA4C,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACjF,OAAO,CACH,KAAC,YAAY,cACT,KAAC,cAAc,cACV,QAAQ,GACI,GACN,CAClB,CAAC;AACN,CAAC,CAAC;AAEF,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin.screen.d.ts","sourceRoot":"","sources":["../../../../src/features/admin/components/admin.screen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,gBAAgB;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,GAAG,CAAC;IACV,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAwDlD,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Text, Box } from 'ink';
|
|
3
|
+
export const AdminScreen = ({ action, data, error, loading }) => {
|
|
4
|
+
if (loading)
|
|
5
|
+
return _jsx(Text, { children: "Processing Admin Command..." });
|
|
6
|
+
if (error)
|
|
7
|
+
return _jsxs(Text, { color: "red", children: ["Error: ", error] });
|
|
8
|
+
if (action === 'list') {
|
|
9
|
+
return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsxs(Text, { bold: true, underline: true, children: ["All Users (", data?.length || 0, ")"] }), Array.isArray(data) && data.map((u) => (_jsx(Box, { children: _jsxs(Text, { color: u.role === 'admin' ? 'red' : 'white', children: [u.username, " (", u.email, ") - ", u.role, " [ID: ", u._id, "]"] }) }, u._id))), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "gray", children: "Press ESC to exit" }) })] }));
|
|
10
|
+
}
|
|
11
|
+
if (action === 'view') {
|
|
12
|
+
return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsx(Text, { bold: true, underline: true, children: "User Details" }), _jsxs(Text, { children: ["ID: ", data?.user?._id] }), _jsxs(Text, { children: ["Username: ", data?.user?.username] }), _jsxs(Text, { children: ["Email: ", data?.user?.email] }), _jsxs(Text, { children: ["Role: ", data?.user?.role] }), _jsxs(Text, { children: ["Created: ", data?.user?.createdAt] }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { bold: true, children: "Profile Data:" }) }), data?.profile ? (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { children: ["Bio: ", data.profile.bio] }), _jsxs(Text, { children: ["Skills: ", data.profile.skills?.join(', ')] })] })) : _jsx(Text, { italic: true, children: "No profile data" }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "gray", children: "Press ESC to exit" }) })] }));
|
|
13
|
+
}
|
|
14
|
+
if (action === 'delete') {
|
|
15
|
+
return (_jsx(Box, { padding: 1, children: _jsxs(Text, { color: "green", children: ["\u2705 ", data?.message] }) }));
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=admin.screen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin.screen.js","sourceRoot":"","sources":["../../../../src/features/admin/components/admin.screen.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAShC,MAAM,CAAC,MAAM,WAAW,GAA+B,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE;IACxF,IAAI,OAAO;QAAE,OAAO,KAAC,IAAI,8CAAmC,CAAC;IAC7D,IAAI,KAAK;QAAE,OAAO,MAAC,IAAI,IAAC,KAAK,EAAC,KAAK,wBAAS,KAAK,IAAQ,CAAC;IAE1D,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QACpB,OAAO,CACH,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAA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MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,aACvB,MAAC,IAAI,wBAAO,IAAI,CAAC,OAAO,CAAC,GAAG,IAAQ,EACpC,MAAC,IAAI,2BAAU,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,IAAQ,IACpD,CACT,CAAC,CAAC,CAAC,KAAC,IAAI,IAAC,MAAM,sCAAuB,EACvC,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACb,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,kCAAyB,GACzC,IACJ,CACT,CAAC;IACN,CAAC;IAED,IAAI,MAAM,KAAK,QAAQ,EAAE,CAAC;QACtB,OAAO,CACH,KAAC,GAAG,IAAC,OAAO,EAAE,CAAC,YACX,MAAC,IAAI,IAAC,KAAK,EAAC,OAAO,wBAAI,IAAI,EAAE,OAAO,IAAQ,GAC1C,CACT,CAAC;IACN,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/admin/components/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,UAAU;IAChB,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;IACnC,EAAE,CAAC,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAGtC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useAdminLogic } from '../hooks/useAdmin.js';
|
|
3
|
+
import { AdminScreen } from './admin.screen.js';
|
|
4
|
+
export const Admin = (props) => {
|
|
5
|
+
const logic = useAdminLogic(props);
|
|
6
|
+
return _jsx(AdminScreen, { ...logic });
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/features/admin/components/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAOhD,MAAM,CAAC,MAAM,KAAK,GAAyB,CAAC,KAAK,EAAE,EAAE;IACjD,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IACnC,OAAO,KAAC,WAAW,OAAK,KAAK,GAAI,CAAC;AACtC,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface UseAdminLogicProps {
|
|
2
|
+
action: 'list' | 'view' | 'delete';
|
|
3
|
+
id?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const useAdminLogic: ({ action, id }: UseAdminLogicProps) => {
|
|
6
|
+
action: "list" | "view" | "delete";
|
|
7
|
+
data: any;
|
|
8
|
+
error: string | null;
|
|
9
|
+
loading: boolean;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=useAdmin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAdmin.d.ts","sourceRoot":"","sources":["../../../../src/features/admin/hooks/useAdmin.ts"],"names":[],"mappings":"AAIA,UAAU,kBAAkB;IACxB,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;IACnC,EAAE,CAAC,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,aAAa,GAAI,gBAAgB,kBAAkB;;;;;CAyC/D,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
import { useApp, useInput } from 'ink';
|
|
3
|
+
import api from '../../../api.js';
|
|
4
|
+
export const useAdminLogic = ({ action, id }) => {
|
|
5
|
+
const { exit } = useApp();
|
|
6
|
+
const [data, setData] = useState(null);
|
|
7
|
+
const [error, setError] = useState(null);
|
|
8
|
+
const [loading, setLoading] = useState(true);
|
|
9
|
+
useInput((input, key) => {
|
|
10
|
+
if (key.escape) {
|
|
11
|
+
exit();
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
const runAction = async () => {
|
|
16
|
+
try {
|
|
17
|
+
if (action === 'list') {
|
|
18
|
+
const res = await api.get('/admin/users');
|
|
19
|
+
setData(res.data);
|
|
20
|
+
}
|
|
21
|
+
else if (action === 'view' && id) {
|
|
22
|
+
const res = await api.get(`/admin/users/${id}`);
|
|
23
|
+
setData(res.data);
|
|
24
|
+
}
|
|
25
|
+
else if (action === 'delete' && id) {
|
|
26
|
+
await api.delete(`/admin/users/${id}`);
|
|
27
|
+
setData({ message: `User ${id} deleted successfully.` });
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
setError(err.response?.data?.message || err.message || 'Operation failed');
|
|
32
|
+
}
|
|
33
|
+
finally {
|
|
34
|
+
setLoading(false);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
runAction();
|
|
38
|
+
}, [action, id]);
|
|
39
|
+
return {
|
|
40
|
+
action,
|
|
41
|
+
data,
|
|
42
|
+
error,
|
|
43
|
+
loading
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=useAdmin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAdmin.js","sourceRoot":"","sources":["../../../../src/features/admin/hooks/useAdmin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,GAAG,MAAM,iBAAiB,CAAC;AAOlC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAAE,MAAM,EAAE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,GAAG,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,IAAI,GAAG,CAAC,OAAO,IAAI,kBAAkB,CAAC,CAAC;YAC/E,CAAC;oBAAS,CAAC;gBACP,UAAU,CAAC,KAAK,CAAC,CAAC;YACtB,CAAC;QACL,CAAC,CAAC;QAEF,SAAS,EAAE,CAAC;IAChB,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC;IAEjB,OAAO;QACH,MAAM;QACN,IAAI;QACJ,KAAK;QACL,OAAO;KACV,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/admin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/features/admin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatList.d.ts","sourceRoot":"","sources":["../../../../src/features/chat/components/ChatList.tsx"],"names":[],"mappings":"AAkBA,eAAO,MAAM,QAAQ,+CAkFpB,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { Box, Text, useApp, useInput } from 'ink';
|
|
4
|
+
import api from '../../../api.js';
|
|
5
|
+
import { useChatLogic } from '../hooks/useChat.js';
|
|
6
|
+
import { ChatScreen } from './chat.screen.js';
|
|
7
|
+
export const ChatList = () => {
|
|
8
|
+
const { exit } = useApp();
|
|
9
|
+
const [conversations, setConversations] = useState([]);
|
|
10
|
+
const [loading, setLoading] = useState(true);
|
|
11
|
+
const [error, setError] = useState(null);
|
|
12
|
+
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
13
|
+
const [activeChatUser, setActiveChatUser] = useState(null);
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
// Only load if not chatting
|
|
16
|
+
if (activeChatUser)
|
|
17
|
+
return;
|
|
18
|
+
api.get('/chat/conversations')
|
|
19
|
+
.then(({ data }) => {
|
|
20
|
+
setConversations(data);
|
|
21
|
+
setLoading(false);
|
|
22
|
+
})
|
|
23
|
+
.catch(err => {
|
|
24
|
+
setError(err.message || 'Failed to load conversations');
|
|
25
|
+
setLoading(false);
|
|
26
|
+
});
|
|
27
|
+
}, [activeChatUser]);
|
|
28
|
+
useInput((input, key) => {
|
|
29
|
+
if (activeChatUser)
|
|
30
|
+
return; // Disable list nav when chatting
|
|
31
|
+
if (key.escape) {
|
|
32
|
+
exit();
|
|
33
|
+
}
|
|
34
|
+
if (key.upArrow) {
|
|
35
|
+
setSelectedIndex(prev => Math.max(0, prev - 1));
|
|
36
|
+
}
|
|
37
|
+
if (key.downArrow) {
|
|
38
|
+
setSelectedIndex(prev => Math.min(conversations.length - 1, prev + 1));
|
|
39
|
+
}
|
|
40
|
+
if (key.return) {
|
|
41
|
+
const target = conversations[selectedIndex]?.user.username;
|
|
42
|
+
if (target) {
|
|
43
|
+
setActiveChatUser(target);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
if (activeChatUser) {
|
|
48
|
+
return _jsx(ActiveChat, { username: activeChatUser, onBack: () => setActiveChatUser(null) });
|
|
49
|
+
}
|
|
50
|
+
if (loading)
|
|
51
|
+
return _jsx(Text, { children: "Loading conversations..." });
|
|
52
|
+
if (error)
|
|
53
|
+
return _jsxs(Text, { color: "red", children: ["Error: ", error] });
|
|
54
|
+
if (conversations.length === 0) {
|
|
55
|
+
return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsx(Text, { children: "No conversations found." }), _jsxs(Text, { color: "gray", children: ["Start a chat with: ", _jsx(Text, { color: "cyan", children: "hackmate chat dm <username>" })] }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "yellow", children: "Press ESC to exit" }) })] }));
|
|
56
|
+
}
|
|
57
|
+
return (_jsxs(Box, { flexDirection: "column", padding: 1, borderStyle: "round", borderColor: "blue", children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { bold: true, children: "Direct Messages" }) }), conversations.map((conv, i) => (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Text, { color: i === selectedIndex ? 'green' : 'white', children: [i === selectedIndex ? '> ' : ' ', "@", conv.user.username, " ", _jsxs(Text, { color: "gray", children: ["(", new Date(conv.lastMessage.createdAt).toLocaleDateString(), ")"] })] }), _jsxs(Text, { color: "gray", dimColor: true, children: [conv.lastMessage.content.substring(0, 50), "..."] })] }, conv.user.id))), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "cyan", children: "Press Enter to chat, ESC to exit" }) })] }));
|
|
58
|
+
};
|
|
59
|
+
const ActiveChat = ({ username, onBack }) => {
|
|
60
|
+
const logic = useChatLogic({ targetUsername: username, onExit: onBack });
|
|
61
|
+
return _jsx(ChatScreen, { ...logic });
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=ChatList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatList.js","sourceRoot":"","sources":["../../../../src/features/chat/components/ChatList.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAClD,OAAO,GAAG,MAAM,iBAAiB,CAAC;AAalC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,E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,EAAE,CAAC,CAAC;IACzE,OAAO,KAAC,UAAU,OAAK,KAAK,GAAI,CAAC;AACrC,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ChatScreenProps {
|
|
3
|
+
messages: any[];
|
|
4
|
+
input: string;
|
|
5
|
+
setInput: (val: string) => void;
|
|
6
|
+
status: string;
|
|
7
|
+
handleSend: () => void;
|
|
8
|
+
exit: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const ChatScreen: React.FC<ChatScreenProps>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=chat.screen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat.screen.d.ts","sourceRoot":"","sources":["../../../../src/features/chat/components/chat.screen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,eAAe;IACrB,QAAQ,EAAE,GAAG,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,IAAI,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAiChD,CAAC"}
|