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