feat: finish card components

This commit is contained in:
Joel
2024-10-10 17:47:04 +08:00
parent 19f5684960
commit 946068967b
28 changed files with 297 additions and 28 deletions

View File

@ -15,11 +15,11 @@ const Description: FC<Props> = ({
}) => {
const lineClassName = useMemo(() => {
if (descriptionLineRows === 1)
return 'truncate'
return 'h-4 truncate'
else if (descriptionLineRows === 2)
return 'line-clamp-2'
return 'h-8 line-clamp-2'
else
return 'line-clamp-3'
return 'h-12 line-clamp-3'
}, [descriptionLineRows])
return (
<div className={cn('text-text-tertiary system-xs-regular', lineClassName, className)}>

View File

@ -0,0 +1,19 @@
import { RiInstallLine } from '@remixicon/react'
import { formatNumber } from '@/utils/format'
type Props = {
downloadCount: number
}
const DownloadCount = ({
downloadCount,
}: Props) => {
return (
<div className="flex items-center space-x-1 text-text-tertiary">
<RiInstallLine className="shrink-0 w-3 h-3" />
<div className="system-xs-regular">{formatNumber(downloadCount)}</div>
</div>
)
}
export default DownloadCount