fix: format user count

fix/count
Arik Chakma 3 months ago
parent 3b40b61013
commit e3143cf68b
  1. 7
      src/components/Projects/ProjectCard.tsx
  2. 2
      src/data/projects/task-tracker-js.md

@ -4,6 +4,7 @@ import type {
ProjectFileType,
} from '../../lib/project.ts';
import { Users } from 'lucide-react';
import { formatCommaNumber } from '../../lib/number.ts';
type ProjectCardProps = {
project: ProjectFileType;
@ -39,7 +40,11 @@ export function ProjectCard(props: ProjectCardProps) {
</span>
<span className="flex items-center gap-2 text-xs text-gray-400">
<Users className="inline-block size-3.5" />
{userCount > 0 ? <>{userCount} Started</> : <>Be the first to solve!</>}
{userCount > 0 ? (
<>{formatCommaNumber(userCount)} Started</>
) : (
<>Be the first to solve!</>
)}
</span>
</a>
);

@ -1,6 +1,6 @@
---
title: 'Task Tracker'
description: 'Create a task tracker with a to-do list using HTML, CSS, and JavaScript.'
description: 'Create a task tracker with a to-do list using JavaScript.'
isNew: false
sort: 22
difficulty: 'intermediate'

Loading…
Cancel
Save