import { useStore } from '@nanostores/react'; import classNames from 'classnames'; import { AnimatePresence, motion } from 'framer-motion'; import { useCallback, useMemo } from 'react'; import { webBuilderStore } from '~/lib/stores/web-builder'; interface Props { postMessage: (message: string) => void; } export default function ChatAlert({ postMessage }: Props) { const actionAlert = useStore(webBuilderStore.chatStore.alert); const { description, content } = useMemo(() => actionAlert ?? { description: '', content: '' }, [actionAlert]); const handlePostMessage = useCallback( (message: string) => { postMessage(message); handleClearAlert(); }, [postMessage], ); const handleClearAlert = useCallback(() => { webBuilderStore.chatStore.clearAlert(); }, [webBuilderStore]); return (
{/* Icon */}
{/* Content */}
预览错误

我们遇到了预览错误。是否想让 UPage 分析并帮助解决这个问题?

{description && (
Error: {description}
)}
{/* Actions */}
); }