Added Ability to add Due Dates to Cards

This commit is contained in:
Ahmad 2024-03-15 17:01:41 -04:00
parent be1ddcb0ad
commit 8ef97bf854
No known key found for this signature in database
GPG key ID: 8FD8A93530D182BF
8 changed files with 207 additions and 4 deletions

View file

@ -2,8 +2,10 @@
import { Draggable } from '@hello-pangea/dnd';
import { Card } from '@prisma/client';
import { format } from 'date-fns';
import { useCardModal } from '@/hooks/use-card-modal';
import { Calendar } from 'lucide-react';
interface CardItemProps {
index: number;
@ -25,6 +27,10 @@ export const CardItem = ({ index, data }: CardItemProps) => {
className='truncate rounded-md border-2 border-transparent bg-white px-3 py-2 text-sm shadow-sm hover:border-black'
>
{data.title}
<div className='flex w-fit rounded-md border-2 border-transparent bg-slate-100 px-0.5 pb-0.5 pt-0.5 text-sm'>
<Calendar className='ml-0.5 mr-0.5 h-4 w-4' />
{data?.dueDate ? 'Due: ' + format(data.dueDate, 'PP') : 'No Due Date'}
</div>
</div>
)}
</Draggable>