"use client"; import { Avatar } from "@/components/ui/avatar"; import { cn } from "@/lib/utils"; import type { ContactCard } from "@/lib/jmap/types"; import { getContactDisplayName, getContactPrimaryEmail } from "@/stores/contact-store"; import { CheckSquare, Square } from "lucide-react"; import type { Density } from "@/stores/settings-store"; interface ContactListItemProps { contact: ContactCard; isSelected: boolean; isChecked: boolean; hasSelection: boolean; density: Density; onClick: (e: React.MouseEvent) => void; onCheckboxClick: (e: React.MouseEvent) => void; } export function ContactListItem({ contact, isSelected, isChecked, hasSelection, density, onClick, onCheckboxClick }: ContactListItemProps) { const name = getContactDisplayName(contact); const email = getContactPrimaryEmail(contact); const org = contact.organizations ? Object.values(contact.organizations)[0]?.name : undefined; return (
{hasSelection && ( )} {density !== 'extra-compact' && ( )}
{name || email || "—"}
{density !== 'extra-compact' && email && name && (
{email}
)} {density === 'comfortable' && org && (
{org}
)}
); }