diff --git a/src/ui/Layout.tsx b/src/ui/Layout.tsx index fa3168a..933b4fb 100644 --- a/src/ui/Layout.tsx +++ b/src/ui/Layout.tsx @@ -3,31 +3,35 @@ import { AppSidebar } from './components/AppSidebar' import { Icons } from './components/Icons' import { Separator } from './components/ui/separator' import { SidebarInset, SidebarProvider, SidebarTrigger } from './components/ui/sidebar' +import { Toaster } from './components/ui/sonner' export default function Layout() { return ( - - - - - - - - Forgery - - - - - - - - - - + <> + + + + + + + + Forgery + + + + + + + + + + + + > ) } diff --git a/src/ui/components/CreateLookDialog.tsx b/src/ui/components/CreateLookDialog.tsx index f19c00f..7ef8774 100644 --- a/src/ui/components/CreateLookDialog.tsx +++ b/src/ui/components/CreateLookDialog.tsx @@ -11,12 +11,12 @@ import { SaveOutfitDialog } from './SaveOutfitDialog' import { Badge } from './ui/badge' import { Button } from './ui/button' import { - Dialog, - DialogContent, - DialogDescription, - DialogFooter, - DialogHeader, - DialogTitle, + Dialog, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogTitle, } from './ui/dialog' import { Label } from './ui/label' import { ScrollArea, ScrollBar } from './ui/scroll-area' @@ -52,7 +52,6 @@ export const CreateLookDialog: React.FC = ({ const [selectedExpressionId, setSelectedExpressionId] = useState(null) const [userPrompt, setUserPrompt] = useState('') const [submitting, setSubmitting] = useState(false) - const [error, setError] = useState(null) const [loadOutfitOpen, setLoadOutfitOpen] = useState(false) const [saveOutfitOpen, setSaveOutfitOpen] = useState(false) @@ -143,7 +142,6 @@ export const CreateLookDialog: React.FC = ({ const handleCreate = async () => { if (selectedEquipments.length === 0) return setSubmitting(true) - setError(null) try { const res = await client.generations.$post({ @@ -167,7 +165,7 @@ export const CreateLookDialog: React.FC = ({ setUserPrompt('') } catch (e) { console.error(e) - setError(e instanceof Error ? e.message : 'Something went wrong') + toast.error(e instanceof Error ? e.message : 'Something went wrong') } finally { setSubmitting(false) } @@ -532,7 +530,6 @@ export const CreateLookDialog: React.FC = ({ - {error && {error}} = ({ console.error(e) const err = e instanceof Error ? e : new Error(String(e)) toast.error(err.message || 'Refinement failed') + setStage('selection') } } diff --git a/src/ui/components/ui/sonner.tsx b/src/ui/components/ui/sonner.tsx index 9f46e06..ef6164f 100644 --- a/src/ui/components/ui/sonner.tsx +++ b/src/ui/components/ui/sonner.tsx @@ -1,19 +1,19 @@ import { - CircleCheckIcon, - InfoIcon, - Loader2Icon, - OctagonXIcon, - TriangleAlertIcon, -} from "lucide-react" -import { useTheme } from "next-themes" -import { Toaster as Sonner, type ToasterProps } from "sonner" + CircleCheckIcon, + InfoIcon, + Loader2Icon, + OctagonXIcon, + TriangleAlertIcon, +} from 'lucide-react' +import { useTheme } from 'next-themes' +import { Toaster as Sonner, type ToasterProps } from 'sonner' const Toaster = ({ ...props }: ToasterProps) => { - const { theme = "system" } = useTheme() + const { theme = 'system' } = useTheme() return ( , @@ -24,10 +24,11 @@ const Toaster = ({ ...props }: ToasterProps) => { }} style={ { - "--normal-bg": "var(--popover)", - "--normal-text": "var(--popover-foreground)", - "--normal-border": "var(--border)", - "--border-radius": "var(--radius)", + '--normal-bg': 'white', + '--normal-text': 'var(--popover-foreground)', + '--normal-border': 'var(--border)', + '--border-radius': 'var(--radius)', + zIndex: 99, } as React.CSSProperties } {...props}