"use client"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; import Link from "next/link"; import { PendingTask } from "@/types/dashboard"; import { AlertCircle, ArrowRight } from "lucide-react"; interface PendingTasksProps { tasks: PendingTask[] | undefined; isLoading: boolean; } export function PendingTasks({ tasks, isLoading }: PendingTasksProps) { if (isLoading) { return ( Pending Tasks
{[...Array(3)].map((_, i) => (
))}
) } if (!tasks) tasks = []; return ( Pending Tasks {tasks.length > 0 && ( {tasks.length} )}
{tasks.length === 0 ? (

No pending tasks. Good job!

) : ( tasks.map((task) => (
{task.title} {task.daysOverdue > 0 ? ( {task.daysOverdue}d overdue ) : ( Due Soon )}

{task.description}

View Details
)) )}
); }