import dynamic from "next/dynamic"; import { ReferenceIcon } from "@/components/lovart/reference-icon"; import { ModelIdentityIcon } from "@/components/lovart/model-identity-icon"; import { Lightbulb, Loader2, X } from "lucide-react"; import { useRef, type ChangeEvent } from "react"; import { Button } from "@/components/ui/button"; import { Select, SelectContent, SelectItem, SelectTrigger, } from "@/components/ui/select"; import { Textarea } from "@/components/ui/textarea"; import { cn } from "@/lib/utils"; import type { ModelOption, UploadFileItem } from "./types"; const HomeAnimationEmbed = dynamic( () => import("@/components/home/home-animation-embed").then( (module) => module.HomeAnimationEmbed ), { loading: () => (
), ssr: false, } ); type LovartHeroComposerProps = { composerPlaceholder: string; displayLogo: string; files: UploadFileItem[]; handleAddFiles: (files: FileList | null) => void; heroPromoActionText?: string | null; heroPromoText?: string | null; heroSubtitleText?: string | null; heroTitleText?: string | null; homeAnimationData?: { enabled?: boolean; htmlContent?: string; fileName?: string; }; isAgentModeActive: boolean; isMembershipEnabled: boolean; isSubmitting: boolean; onSubmit: () => void; openUpgradeDialog: () => void; prompt: string; removeFile: (id: string) => void; setPrompt: (value: string) => void; siteName: string; modelOptions: ModelOption[]; onModelChange: (modelId: string) => void; onStartAgentMode: () => void; selectedModelId: string; onOpenGallery: () => void; }; export function LovartHeroComposer({ composerPlaceholder, files, handleAddFiles, heroSubtitleText, heroTitleText, homeAnimationData, isAgentModeActive, isSubmitting, onSubmit, prompt, removeFile, setPrompt, siteName, modelOptions, onModelChange, onStartAgentMode, selectedModelId, onOpenGallery, }: LovartHeroComposerProps) { const textareaRef = useRef{heroSubtitleText}
) : null}