* Make thread screen as default screen * Blank state when user have not any model * Cleanup topbar thread screen * Improve style right panel * Add instructions right panel * Styling thread list history * Resolve conflict * Default title new thread * Fix trigger panel sidebar * Make default right panel false when no activethread * Fix CI test * chore: assistant instruction with system prompt * Fix title and blank state explore the hub * Claenup style thread screen and add buble message for assitant * Remove unused import * Styling more menus on thread list and right panel, and make max height textarea 400 pixel * Finished revamp ui thread * Finished system monitor UI * Style box running models * Make animate right panel more smooth * Add status arround textarea for starting model info * Temporary disable hide left panel * chore: system resource monitoring update * copy nits * chore: typo * Reverse icon chevron accordion * Move my models into setting page --------- Co-authored-by: Louis <louis@jan.ai> Co-authored-by: 0xSage <n@pragmatic.vc>
66 lines
1.8 KiB
TypeScript
66 lines
1.8 KiB
TypeScript
import { useState } from 'react'
|
|
|
|
import { Input } from '@janhq/uikit'
|
|
|
|
import { SearchIcon } from 'lucide-react'
|
|
|
|
import { useGetDownloadedModels } from '@/hooks/useGetDownloadedModels'
|
|
|
|
import RowModel from './Row'
|
|
|
|
const Column = ['Name', 'Model ID', 'Size', 'Version', 'Status', '']
|
|
|
|
export default function Models() {
|
|
const { downloadedModels } = useGetDownloadedModels()
|
|
const [searchValue, setsearchValue] = useState('')
|
|
|
|
const filteredDownloadedModels = downloadedModels.filter((x) => {
|
|
return x.name.toLowerCase().includes(searchValue.toLowerCase())
|
|
})
|
|
|
|
return (
|
|
<div className="rounded-xl border border-border shadow-sm">
|
|
<div className="px-6 py-5">
|
|
<div className="relative w-1/3">
|
|
<SearchIcon
|
|
size={20}
|
|
className="absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"
|
|
/>
|
|
<Input
|
|
placeholder="Search"
|
|
className="pl-8"
|
|
onChange={(e) => {
|
|
setsearchValue(e.target.value)
|
|
}}
|
|
/>
|
|
</div>
|
|
</div>
|
|
<div className="relative">
|
|
<table className="w-full px-8">
|
|
<thead className="w-full border-b border-border bg-secondary">
|
|
<tr>
|
|
{Column.map((col, i) => {
|
|
return (
|
|
<th
|
|
key={i}
|
|
className="px-6 py-2 text-left font-normal last:text-center"
|
|
>
|
|
{col}
|
|
</th>
|
|
)
|
|
})}
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{filteredDownloadedModels
|
|
? filteredDownloadedModels.map((x, i) => {
|
|
return <RowModel key={i} data={x} />
|
|
})
|
|
: null}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|