Skip to content

Commit

Permalink
Add cover image model hub screen
Browse files Browse the repository at this point in the history
  • Loading branch information
urmauur committed Dec 6, 2023
1 parent f3fbade commit d63c9c3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 15 deletions.
1 change: 1 addition & 0 deletions core/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ export type ModelMetadata = {
author: string;
tags: string[];
size: number;
cover?: string;
};

/**
Expand Down
37 changes: 22 additions & 15 deletions web/screens/ExploreModels/ExploreModelItemHeader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,23 +98,30 @@ const ExploreModelItemHeader: React.FC<Props> = ({ model, onClick, open }) => {

return (
<div
className="flex cursor-pointer items-center justify-between rounded-t-md bg-background/50 px-4 py-4"
className="cursor-pointer rounded-t-md bg-background/50"
onClick={onClick}
>
<div className="flex items-center gap-2">
<span className="font-bold">{model.name}</span>
</div>
<div className="inline-flex items-center space-x-2">
<span className="mr-4 font-semibold text-muted-foreground">
{toGigabytes(model.metadata.size)}
</span>
{downloadButton}
<ChevronDownIcon
className={twMerge(
'h-5 w-5 flex-none text-gray-400',
open === model.id && 'rotate-180'
)}
/>
{model.metadata.cover && (
<div className="relative h-full w-full">
<img src={model.metadata.cover} alt={`Cover - ${model.id}`} />
</div>
)}
<div className="flex items-center justify-between p-4">
<div className="flex items-center gap-2">
<span className="font-bold">{model.name}</span>
</div>
<div className="inline-flex items-center space-x-2">
<span className="mr-4 font-semibold text-muted-foreground">
{toGigabytes(model.metadata.size)}
</span>
{downloadButton}
<ChevronDownIcon
className={twMerge(
'h-5 w-5 flex-none text-gray-400',
open === model.id && 'rotate-180'
)}
/>
</div>
</div>
</div>
)
Expand Down

0 comments on commit d63c9c3

Please sign in to comment.