'use client'; import { motion } from 'framer-motion'; import { Button } from './ui/button'; import { ChatRequestOptions, CreateMessage, Message } from 'ai'; import { memo } from 'react'; interface SuggestedActionsProps { chatId: string; append: ( message: Message | CreateMessage, chatRequestOptions?: ChatRequestOptions, ) => Promise; } function PureSuggestedActions({ chatId, append }: SuggestedActionsProps) { const suggestedActions = [ { title: 'What are the advantages', label: 'of using Next.js?', action: 'What are the advantages of using Next.js?', }, { title: 'Write code to', label: `demonstrate djikstra's algorithm`, action: `Write code to demonstrate djikstra's algorithm`, }, { title: 'Help me write an essay', label: `about silicon valley`, action: `Help me write an essay about silicon valley`, }, { title: 'What is the weather', label: 'in San Francisco?', action: 'What is the weather in San Francisco?', }, ]; return (
{suggestedActions.map((suggestedAction, index) => ( 1 ? 'hidden sm:block' : 'block'} > ))}
); } export const SuggestedActions = memo(PureSuggestedActions, () => true);