Skip to content

Commit

Permalink
Published digest date in team listing (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucieo authored Oct 26, 2023
1 parent 900086f commit 7d6438b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/components/digests/Digests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { DigestBlockType } from '@prisma/client';
import clsx from 'clsx';
import Link from 'next/link';
import NoContent from '../layout/NoContent';
import { formatDate } from '@/utils/date';

type Props = {
digests: TeamDigestsResult[];
Expand Down Expand Up @@ -41,9 +42,14 @@ export const Digests = ({ digests, teamSlug }: Props) => {
</Link>
<div className="flex items-center text-sm text-gray-500">
{digest.publishedAt ? (
<div className="flex items-center">
<CheckIcon className="text-green-600 h-4 w-4" /> Published
</div>
<>
<div className="flex items-center">
<CheckIcon className="text-green-600 h-4 w-4" /> Published
</div>
<time className="text-gray-500 pl-1">
- {formatDate(digest.publishedAt!, 'MMMM dd, yyyy')}
</time>
</>
) : (
<div>Draft</div>
)}
Expand Down

0 comments on commit 7d6438b

Please sign in to comment.