diff --git a/src/apps/link/AppLinkChat.tsx b/src/apps/link/AppLinkChat.tsx index fe64379c0..7b4bf4b61 100644 --- a/src/apps/link/AppLinkChat.tsx +++ b/src/apps/link/AppLinkChat.tsx @@ -102,6 +102,7 @@ export function AppLinkChat(props: { chatLinkId: string | null }) { // state const [deleteConfirmId, setDeleteConfirmId] = React.useState(null); const [deleteConfirmKey, setDeleteConfirmKey] = React.useState(null); + const [showDeletionKeys, setShowDeletionKeys] = React.useState(false); // derived state 1 const isListPage = props.chatLinkId === SPECIAL_LIST_PAGE_ID; @@ -189,13 +190,16 @@ export function AppLinkChat(props: { chatLinkId: string | null }) { const drawerContent = React.useMemo(() => , [handleConfirmDeletion, linkId, sharedChatLinkItems]); + />, [handleConfirmDeletion, linkId, sharedChatLinkItems, showDeletionKeys]); const menuItems = React.useMemo(() => , [handleConfirmDeletion, linkId]); + onToggleDeletionKeys={() => setShowDeletionKeys(on => !on)} + />, [handleConfirmDeletion, linkId, showDeletionKeys]); usePluggableOptimaLayout(drawerContent, null, menuItems, 'AppChatLink'); diff --git a/src/apps/link/LinkChatDrawer.tsx b/src/apps/link/LinkChatDrawer.tsx index 62adf18fb..17f3a473e 100644 --- a/src/apps/link/LinkChatDrawer.tsx +++ b/src/apps/link/LinkChatDrawer.tsx @@ -20,6 +20,7 @@ import { useOptimaDrawers } from '~/common/layout/optima/useOptimaDrawers'; export function LinkChatDrawer(props: { activeLinkId: string | null, sharedChatLinkItems: SharedChatLinkItem[] + showDeletionKeys: boolean, onDeleteLink: (linkId: string) => void, }) { @@ -70,6 +71,9 @@ export function LinkChatDrawer(props: { {item.chatTitle || 'Untitled Chat'} + {props.showDeletionKeys && + Deletion Key: {item.deletionKey} + } diff --git a/src/apps/link/LinkChatMenuItems.tsx b/src/apps/link/LinkChatMenuItems.tsx index 5a4ff5925..230d6c9cc 100644 --- a/src/apps/link/LinkChatMenuItems.tsx +++ b/src/apps/link/LinkChatMenuItems.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { shallow } from 'zustand/shallow'; -import { ListItemDecorator, MenuItem, Switch, Typography } from '@mui/joy'; +import { ListDivider, ListItemDecorator, MenuItem, Switch, Typography } from '@mui/joy'; import DeleteOutlineIcon from '@mui/icons-material/DeleteOutline'; import { useUIPreferencesStore } from '~/common/state/store-ui'; @@ -14,7 +14,9 @@ import { useChatShowSystemMessages } from '../chat/store-app-chat'; */ export function LinkChatMenuItems(props: { activeLinkId: string | null, + showDeletionKeys: boolean, onDeleteLink: (linkId: string) => void, + onToggleDeletionKeys: () => void, }) { // external state @@ -79,6 +81,18 @@ export function LinkChatMenuItems(props: { /> + + + Show Keys + + + + + + Delete