diff --git a/packages/desktop/src/app.tsx b/packages/desktop/src/app.tsx
index 18df2a4..b8c0a8e 100644
--- a/packages/desktop/src/app.tsx
+++ b/packages/desktop/src/app.tsx
@@ -2,7 +2,7 @@ import { ThemeProvider } from '@mui/material';
import * as React from 'react';
import ReactDOM from 'react-dom/client';
-import Terminal from './components/Terminal';
+import { TerminalProvider } from './components/Terminal';
import { SnackbarProvider } from 'notistack';
import { NirvanaTheme } from './mui/NirvanaTheme';
@@ -20,7 +20,7 @@ root.render(
-
+
diff --git a/packages/desktop/src/components/Conversations.tsx b/packages/desktop/src/components/Conversations.tsx
index 57d2ee6..55fe8fe 100644
--- a/packages/desktop/src/components/Conversations.tsx
+++ b/packages/desktop/src/components/Conversations.tsx
@@ -1,4 +1,4 @@
-import React from 'react';
+import React, { useCallback, useRef } from 'react';
import {
Avatar,
@@ -10,15 +10,52 @@ import {
ListItemButton,
ListItemText,
ListSubheader,
+ Stack,
Typography,
+ Input,
} from '@mui/material';
import { blueGrey } from '@mui/material/colors';
-import { FiActivity, FiInbox } from 'react-icons/fi';
+import { FiActivity, FiInbox, FiSearch } from 'react-icons/fi';
import NirvanaAvatar from './NirvanaAvatar';
+import { useKey } from 'react-use';
+import { useSnackbar } from 'notistack';
+import KeyboardShortcutLabel from './KeyboardShortcutLabel';
const Conversations = () => {
+ const { enqueueSnackbar } = useSnackbar();
+
+ const searchRef = useRef(null);
+
+ const onSearch = useCallback(() => {
+ enqueueSnackbar('search focused');
+ if (searchRef?.current) searchRef.current.focus();
+ }, []);
+
+ useKey('Shift', onSearch);
+
return (
<>
+
+
+
+
+
+
+
+
({});
+
+export function TerminalProvider({ children }: { children?: React.ReactNode }) {
const { enqueueSnackbar } = useSnackbar();
return (
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {'Viet Phan'}
-
-
-
-
-
-
-
-
-
-
-
-
-
- yesterday
-
-
-
-
-
-
-
- {'Viet Phan'}
-
-
-
-
-
-
-
-
-
-
-
- today
-
-
-
-
-
-
-
- {'Viet Phan'}
-
-
-
-
-
-
-
-
-
-
-
- right now
-
-
-
-
-
-
-
- {'Arjun Patel'}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+ {'Viet Phan'}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ yesterday
+
+
+
+
+
+
+
+ {'Viet Phan'}
+
+
+
+
+
+
+
+
+
+
+
+ today
+
+
+
+
+
+
+
+ {'Viet Phan'}
+
+
+
+
+
+
+
+
+
+
+
+ right now
+
+
+
+
+
+
+
+ {'Arjun Patel'}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+ {children}
+
);
}
-const searchShortcut = 'Shift';
-const SecondNavbar = () => {
- const { enqueueSnackbar } = useSnackbar();
-
- const searchRef = useRef(null);
-
- const onSearch = useCallback(() => {
- enqueueSnackbar('search focused');
- if (searchRef?.current) searchRef.current.focus();
- }, []);
-
- useKey('Shift', onSearch);
-
- return (
-
-
-
-
-
-
-
- );
-};
+export default function useTerminal() {
+ return useContext(TerminalContext);
+}
diff --git a/packages/desktop/src/util/keyboard.ts b/packages/desktop/src/util/keyboard.ts
new file mode 100644
index 0000000..fc97a06
--- /dev/null
+++ b/packages/desktop/src/util/keyboard.ts
@@ -0,0 +1 @@
+const searchShortcut = 'Shift';