MCPcopy Create free account
hub / github.com/ComfyWorkflows/ComfyUI-Launcher / MissingModelItem

Function MissingModelItem

web/src/components/MissingModelItem.tsx:26–234  ·  view source on GitHub ↗
({
    missingModel,
    resolveMutationToUse,
    unResolveMutationToUse,
}: {
    missingModel: MissingModel
    resolveMutationToUse: UseMutationResult<
        void,
        Error,
        {
            filename: string
            node_type: string
            dest_relative_path: string
            source: Source
        },
        unknown
    >
    unResolveMutationToUse: UseMutationResult<
        void,
        Error,
        { filename: string },
        unknown
    >
})

Source from the content-addressed store, hash-verified

24} from '@/components/ui/collapsible'
25
26function MissingModelItem({
27 missingModel,
28 resolveMutationToUse,
29 unResolveMutationToUse,
30}: {
31 missingModel: MissingModel
32 resolveMutationToUse: UseMutationResult<
33 void,
34 Error,
35 {
36 filename: string
37 node_type: string
38 dest_relative_path: string
39 source: Source
40 },
41 unknown
42 >
43 unResolveMutationToUse: UseMutationResult<
44 void,
45 Error,
46 { filename: string },
47 unknown
48 >
49}) {
50 const [loading, setLoading] = useState(false)
51 const [resolved, setResolved] = useState(false)
52 const [newFileName, setNewFileName] = useState('')
53 const [isOpen, setIsOpen] = useState(true)
54
55 if (!resolved) {
56 return (
57 <Collapsible
58 open={isOpen}
59 onOpenChange={setIsOpen}
60 className="w-full flex flex-col items-start space-y-4"
61 >
62 <div className="w-full flex items-center justify-between space-x-4">
63 <div className="w-full flex flex-row items-center justify-between">
64 <div className="flex flex-row items-center gap-2">
65 {loading ? (
66 <Loader2Icon className=" text-orange-500 animate-spin w-5 h-5" />
67 ) : (
68 <AlertTriangle className="w-5 h-5 text-red-500" />
69 )}
70 <h3 className="text-white text-lg font-bold">
71 {missingModel.filename}
72 </h3>
73 <Badge className="flex flex-row items-center gap-2">
74 <InfoIcon className="w-4 h-4" />
75 {missingModel.node_type}
76 </Badge>
77 </div>
78 </div>
79 <CollapsibleTrigger asChild>
80 <Button className="flex flex-row items-center gap-2">
81 <ChevronsUpDown className="h-4 w-4" />
82 {isOpen ? 'hide suggestions' : 'show suggestions'}
83 <span className="sr-only">Toggle</span>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected