import { useStore } from '@nanostores/react'; import { TooltipProvider } from '@radix-ui/react-tooltip'; import WithTooltip from '~/components/ui/Tooltip'; import { useEditChatDescription } from '~/lib/hooks'; import { description as descriptionStore } from '~/lib/persistence'; export function ChatDescription() { const initialDescription = useStore(descriptionStore)!; const { editing, handleChange, handleBlur, handleSubmit, handleKeyDown, currentDescription, toggleEditMode } = useEditChatDescription({ initialDescription, syncWithGlobalStore: true, }); if (!initialDescription) { // doing this to prevent showing edit button until chat description is set return null; } return (
{editing ? (
) : ( <> {currentDescription}
)}
); }