'use client'; import { AnimatePresence, motion } from 'framer-motion'; import { useState } from 'react'; import { useWindowSize } from 'usehooks-ts'; import { UISuggestion } from '@/lib/editor/suggestions'; import { CrossIcon, MessageIcon } from './icons'; import { Button } from '../ui/button'; export const Suggestion = ({ suggestion, onApply, }: { suggestion: UISuggestion; onApply: () => void; }) => { const [isExpanded, setIsExpanded] = useState(false); const { width: windowWidth } = useWindowSize(); return ( {!isExpanded ? ( { setIsExpanded(true); }} whileHover={{ scale: 1.1 }} > ) : (
Assistant
{ setIsExpanded(false); }} >
{suggestion.description}
)} ); };