fix: remove remote model from shortcut models dialog

This commit is contained in:
Faisal Amir 2023-12-20 18:04:53 +07:00
parent 994c6e8acc
commit c723fb6866

View File

@ -1,5 +1,6 @@
import { Fragment, useState, useEffect } from 'react' import { Fragment, useState, useEffect } from 'react'
import { InferenceEngine } from '@janhq/core'
import { import {
CommandModal, CommandModal,
CommandEmpty, CommandEmpty,
@ -57,29 +58,33 @@ export default function CommandListDownloadedModel() {
<CommandEmpty>No Model found.</CommandEmpty> <CommandEmpty>No Model found.</CommandEmpty>
{!isNotDownloadedModel && ( {!isNotDownloadedModel && (
<CommandGroup heading="Your Model"> <CommandGroup heading="Your Model">
{downloadedModels.map((model, i) => { {downloadedModels
return ( .filter((model) => {
<CommandItem return model.engine === InferenceEngine.nitro
key={i} })
value={model.id} .map((model, i) => {
onSelect={() => { return (
onModelActionClick(model.id) <CommandItem
setOpen(false) key={i}
}} value={model.id}
> onSelect={() => {
<DatabaseIcon onModelActionClick(model.id)
size={16} setOpen(false)
className="mr-3 text-muted-foreground" }}
/> >
<div className="flex w-full items-center justify-between"> <DatabaseIcon
<span>{model.id}</span> size={16}
{activeModel && activeModel.id === model.id && ( className="mr-3 text-muted-foreground"
<Badge themes="secondary">Active</Badge> />
)} <div className="flex w-full items-center justify-between">
</div> <span>{model.id}</span>
</CommandItem> {activeModel && activeModel.id === model.id && (
) <Badge themes="secondary">Active</Badge>
})} )}
</div>
</CommandItem>
)
})}
</CommandGroup> </CommandGroup>
)} )}
<CommandGroup heading="Find another model"> <CommandGroup heading="Find another model">