Skip to content

Commit

Permalink
Add reccommended tag
Browse files Browse the repository at this point in the history
  • Loading branch information
urmauur committed Dec 4, 2023
1 parent f0f5b7d commit 3a4f354
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions web/screens/ExploreModels/ExploreModelItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ const ExploreModelItem = forwardRef<HTMLDivElement, Props>(({ model }, ref) => {
</span>
<p className="mt-2 font-medium uppercase">{model.format}</p>
</div>
<div className="mt-4">
{/* <div className="mt-4">
<span className="font-semibold text-muted-foreground">
Compatibility
</span>
<p className="mt-2 font-medium">-</p>
</div>
</div> */}
</div>
</div>
)}
Expand Down
3 changes: 1 addition & 2 deletions web/screens/ExploreModels/ExploreModelItemHeader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { useCallback, useMemo } from 'react'

import { Model } from '@janhq/core'
import { Badge, Button } from '@janhq/uikit'
import { Button } from '@janhq/uikit'

import { atom, useAtomValue } from 'jotai'

Expand Down Expand Up @@ -101,7 +101,6 @@ const ExploreModelItemHeader: React.FC<Props> = ({ model, onClick, open }) => {
>
<div className="flex items-center gap-2">
<span className="font-bold">{model.name}</span>
<Badge>{model.metadata.tags[0]}</Badge>
</div>
<div className="inline-flex items-center space-x-2">
<span className="mr-4 font-semibold text-muted-foreground">
Expand Down
4 changes: 3 additions & 1 deletion web/screens/ExploreModels/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,16 @@ const ExploreModelsScreen = () => {
const [tabActive, setTabActive] = useState('Model')
const { downloadedModels } = useGetDownloadedModels()
const [sortSelected, setSortSelected] = useState('All Model')
const sortMenu = ['All Model', 'Downloaded']
const sortMenu = ['All Model', 'Recommended', 'Downloaded']

const filteredModels = models.filter((x) => {
if (sortSelected === 'Downloaded') {
return (
x.name.toLowerCase().includes(searchValue.toLowerCase()) &&
downloadedModels.some((y) => y.id === x.id)
)
} else if (sortSelected === 'Recommended') {
return x.metadata.tags.includes('Recommended')
} else {
return x.name.toLowerCase().includes(searchValue.toLowerCase())
}
Expand Down

0 comments on commit 3a4f354

Please sign in to comment.