From 2fc21ee9294ca023b41fd7493826e439706f4edf Mon Sep 17 00:00:00 2001 From: Dmytro Stanchiev Date: Wed, 8 Apr 2026 00:56:58 -0400 Subject: [PATCH] feat(ai-toolbar): merge event actions into toolbar, add motion animations and AI summary panel - Add event action props (events, onAddEvent, onImport, onExport, onClearAll) - Show skeleton loading state while session is pending - Render event action buttons (Add, Import, Export, Clear) in action bar - Add AnimatePresence for image preview attach/remove - Replace Card summary panel with animated glass-card panel - Inline AI Summarize button into action bar when authenticated - Add Sparkles icon to AI command section header --- src/components/ai-toolbar.tsx | 253 +++++++++++++++++++++++++--------- 1 file changed, 187 insertions(+), 66 deletions(-) diff --git a/src/components/ai-toolbar.tsx b/src/components/ai-toolbar.tsx index 1cf1c78..8aa2972 100644 --- a/src/components/ai-toolbar.tsx +++ b/src/components/ai-toolbar.tsx @@ -1,9 +1,24 @@ -import { X } from "lucide-react"; +"use client"; + +import { AnimatePresence, motion } from "framer-motion"; +import { + Bot, + CalendarPlus, + Download, + FileUp, + ImageIcon, + Loader2, + Sparkles, + Trash2, + X, +} from "lucide-react"; import Image from "next/image"; +import { IcsFilePicker } from "@/components/ics-file-picker"; import { ImagePicker } from "@/components/image-picker"; import { Button } from "@/components/ui/button"; -import { Card } from "@/components/ui/card"; +import { Separator } from "@/components/ui/separator"; import { Textarea } from "@/components/ui/textarea"; +import type { CalendarEvent } from "@/lib/types"; interface AIToolbarProps { isAuthenticated: boolean; @@ -18,6 +33,12 @@ interface AIToolbarProps { onAiSummarize: () => void; summary: string | null; summaryUpdated: string | null; + // event actions + events: CalendarEvent[]; + onAddEvent: () => void; + onImport: (file: File) => void; + onExport: () => void; + onClearAll: () => void; } export const AIToolbar = ({ @@ -33,86 +54,186 @@ export const AIToolbar = ({ onAiSummarize, summary, summaryUpdated, + events, + onAddEvent, + onImport, + onExport, + onClearAll, }: AIToolbarProps) => { + if (isPending) { + return ( +
+
+
+ ); + } + return ( - <> - {isPending ? ( -
- Loading... -
- ) : ( -
- {isAuthenticated ? ( -
-
+
+
+ {/* AI command — only shown when authenticated */} + {isAuthenticated ? ( + <> +
+
+
+ + + AI Command + +