import { MessageSquarePlusIcon } from 'lucide-react' import type { ReactNode } from 'react' import { CHAT_TEMPLATES, codeSnippetPrompts } from './AIAssistant.prompts' import { ActionCard } from '@/components/layouts/Tabs/ActionCard' import type { SqlSnippet } from '@/state/ai-assistant-state' interface AIOnboardingProps { children: ReactNode sqlSnippets?: SqlSnippet[] suggestions?: { title?: string prompts?: { label: string; description: string }[] } onValueChange: (value: string) => void onFocusInput?: () => void } export const AIOnboarding = ({ children, sqlSnippets, suggestions, onValueChange, onFocusInput, }: AIOnboardingProps) => { const suggestionPrompts = suggestions?.prompts ?? [] const hasSuggestions = suggestionPrompts.length > 0 let templates = CHAT_TEMPLATES if (hasSuggestions) { templates = suggestionPrompts.map((suggestion) => ({ title: suggestion.label, icon: MessageSquarePlusIcon, initialMessage: suggestion.description, })) } else if (sqlSnippets && sqlSnippets.length > 0) { templates = codeSnippetPrompts.map((prompt) => ({ title: prompt.title, icon: prompt.icon, initialMessage: prompt.prompt, })) } return (

Chat with your project

{children}
{hasSuggestions && suggestions?.title && (

{suggestions.title}

)}
{templates.map((template) => ( ))}
) }