import { Head, Link } from '@inertiajs/react'; import { Inbox, MessageSquare, Shield, User } from 'lucide-react'; import { useTranslation } from '@/lib/translations'; import { cn } from '@/lib/utils'; import { index as adminSupportIndex, show as showAdminSupport, } from '@/routes/admin/support'; import type { SupportConversationSummary } from '@/types'; type Props = { stats: { open: number; closed: number; }; conversations: SupportConversationSummary[]; }; export default function AdminSupportIndex({ stats, conversations }: Props) { const { t } = useTranslation(); return ( <>

{t('Support inbox')}

{t( 'Contact threads from users and channel request notes.', )}

{t('Conversations')}

{t(':count rows', { count: conversations.length, })}
{conversations.map((conversation) => (
{conversation.category_label}
{conversation.subject}
{conversation.user?.name} -{' '} {conversation.user?.email}
{conversation.latest_message && (

{ conversation.latest_message .author.name } : {conversation.latest_message.body}

)}
{conversation.messages_count}
))} {conversations.length === 0 && (
{t('No support conversations found.')}
)}
); } AdminSupportIndex.layout = { breadcrumbs: [ { title: 'Support inbox', href: adminSupportIndex(), }, ], }; function Stat({ label, value }: { label: string; value: number }) { const { t } = useTranslation(); return (
{t(label)}{' '} {value}
); } function StatusBadge({ status }: { status: 'open' | 'closed' }) { const { t } = useTranslation(); return ( {status === 'open' ? t('OPEN') : t('CLOSED')} ); }