"use client"; import { Checkbox } from "@/components/ui/checkbox"; import { Badge } from "@/components/ui/badge"; import { formatDate } from "@/lib/utils"; import { Phone, Mail, Calendar, CheckSquare, StickyNote } from "lucide-react"; import Link from "next/link"; const typeIcons = { call: Phone, email: Mail, meeting: Calendar, task: CheckSquare, note: StickyNote, }; const typeColors: Record = { call: "bg-blue-100 text-blue-800", email: "bg-purple-100 text-purple-800", meeting: "bg-orange-100 text-orange-800", task: "bg-green-100 text-green-800", note: "bg-gray-100 text-gray-800", }; type Props = { activity: { id: number; type: string; subject: string; dueDate: string | null; isDone: boolean; dealId?: number | null; dealTitle?: string | null; contactId?: number | null; contactFirstName?: string | null; contactLastName?: string | null; companyId?: number | null; companyName?: string | null; }; onToggle: () => void; }; export function ActivityItem({ activity, onToggle }: Props) { const Icon = typeIcons[activity.type as keyof typeof typeIcons] || StickyNote; return (
{activity.subject}
{activity.type} {activity.dueDate && ( {formatDate(activity.dueDate)} )} {activity.dealTitle && ( {activity.dealTitle} )} {activity.contactFirstName && ( {activity.contactFirstName} {activity.contactLastName} )} {activity.companyName && ( {activity.companyName} )}
); }