-
Author
-
{model.metadata.author}
+
+ {open === model.id && (
+
+
+
+
About
+
+ {model.description || '-'}
+
+
+
+
+
+ Author
+
+
{model.metadata.author}
+
+
+
+ Model ID
+
+
{model.id}
+
+
+
+ Tags
+
+
+ {model.metadata.tags.map((tag, i) => (
+
+ {tag}
+
+ ))}
+
+
+
-
-
Compatibility
-
- {/*
- {toGigabytes(model.metadata.maxRamRequired)} RAM required
- */}
+
+
+
+ Format
+
+
{model.format}
+
+
-
-
-
-
Version
-
- v{model.version}
-
-
-
-
Tags
-
- {model.metadata.tags.map((tag, i) => (
-
- {tag}
-
- ))}
-
-
-
-
+ )}
)
})
diff --git a/web/screens/ExploreModels/ExploreModelItemHeader/index.tsx b/web/screens/ExploreModels/ExploreModelItemHeader/index.tsx
index 6345d5f1e..6c34a2074 100644
--- a/web/screens/ExploreModels/ExploreModelItemHeader/index.tsx
+++ b/web/screens/ExploreModels/ExploreModelItemHeader/index.tsx
@@ -1,16 +1,20 @@
/* eslint-disable react-hooks/exhaustive-deps */
-import { useCallback, useMemo, useState } from 'react'
+import { useCallback, useMemo } from 'react'
import { Model } from '@janhq/core'
import { Badge, Button } from '@janhq/uikit'
import { atom, useAtomValue } from 'jotai'
+import { ChevronDownIcon } from 'lucide-react'
+
+import { twMerge } from 'tailwind-merge'
+
import ModalCancelDownload from '@/containers/ModalCancelDownload'
import { MainViewState } from '@/constants/screens'
-import { ModelPerformance, TagType } from '@/constants/tagType'
+// import { ModelPerformance, TagType } from '@/constants/tagType'
import useDownloadModel from '@/hooks/useDownloadModel'
import { useDownloadState } from '@/hooks/useDownloadState'
@@ -21,18 +25,20 @@ import { toGigabytes } from '@/utils/converter'
type Props = {
model: Model
+ onClick: () => void
+ open: string
}
-const ExploreModelItemHeader: React.FC
= ({ model }) => {
- console.log(model)
+const ExploreModelItemHeader: React.FC = ({ model, onClick, open }) => {
const { downloadModel } = useDownloadModel()
const { downloadedModels } = useGetDownloadedModels()
const { modelDownloadStateAtom, downloadStates } = useDownloadState()
- const [title, setTitle] = useState('Recommended')
+ // const [title, setTitle] = useState('Recommended')
+
+ // const [performanceTag, setPerformanceTag] = useState(
+ // ModelPerformance.PerformancePositive
+ // )
- const [performanceTag, setPerformanceTag] = useState(
- ModelPerformance.PerformancePositive
- )
const downloadAtom = useMemo(
() => atom((get) => get(modelDownloadStateAtom)[model.id]),
[model.id]
@@ -48,18 +54,14 @@ const ExploreModelItemHeader: React.FC = ({ model }) => {
const isDownloaded = downloadedModels.find((md) => md.id === model.id) != null
let downloadButton = (
-
+
)
if (isDownloaded) {
downloadButton = (