Files
alla-allaos-fullstack/src/features/crm/dashboard/components/dashboard-hot-projects.tsx
phaichayon c2a74b6764 task-d5.5.1
2026-06-25 12:16:41 +07:00

57 lines
2.5 KiB
TypeScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
'use client';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table';
import type { CrmDashboardHotProjectRow } from '../api/types';
function formatNumber(value: number) {
return new Intl.NumberFormat('en-US', { maximumFractionDigits: 2 }).format(value);
}
export function DashboardHotProjects({ rows }: { rows: CrmDashboardHotProjectRow[] }) {
return (
<Card>
<CardHeader>
<CardTitle></CardTitle>
<CardDescription></CardDescription>
</CardHeader>
<CardContent>
<Table>
<TableHeader>
<TableRow>
<TableHead></TableHead>
<TableHead></TableHead>
<TableHead className='text-right'>„ˆ</TableHead>
<TableHead></TableHead>
<TableHead className='text-right'></TableHead>
</TableRow>
</TableHeader>
<TableBody>
{rows.length === 0 ? (
<TableRow>
<TableCell colSpan={5} className='text-muted-foreground text-center'>
</TableCell>
</TableRow>
) : (
rows.map((row) => (
<TableRow key={row.opportunityId}>
<TableCell>
<div className='font-medium'>{row.projectName}</div>
<div className='text-muted-foreground text-xs'>{row.opportunityCode}</div>
</TableCell>
<TableCell>{row.customerName}</TableCell>
<TableCell className='text-right'>{formatNumber(row.value)}</TableCell>
<TableCell>{row.assignedSalesName ?? '-'}</TableCell>
<TableCell className='text-right'>{row.probability ?? 0}%</TableCell>
</TableRow>
))
)}
</TableBody>
</Table>
</CardContent>
</Card>
);
}