import { useStore } from '@nanostores/react'; import { AnimatePresence, motion, type Variants } from 'framer-motion'; import { IconButton } from '~/components/ui/IconButton'; import { cubicEasingFn } from '~/utils/easings'; import { workspaceStore } from '../../lib/stores/workspace'; interface WorkspaceProps { chatStarted?: boolean; } const workspaceVariants = { closed: { width: 0, transition: { duration: 0.2, ease: cubicEasingFn, }, }, open: { width: '100%', transition: { duration: 0.5, type: 'spring', }, }, } satisfies Variants; export function Workspace({ chatStarted }: WorkspaceProps) { const showWorkspace = useStore(workspaceStore.showWorkspace); return ( chatStarted && ( {showWorkspace && (
{ workspaceStore.showWorkspace.set(false); }} />
)}
) ); }