feat: add Indonesian log type mapping and color chips to report

This commit is contained in:
Iqbal
2026-05-11 15:01:44 +07:00
parent d96e439b2a
commit 80204a7abb
2 changed files with 46 additions and 24 deletions

View File

@@ -41,6 +41,18 @@ const statusColors: Record<string, 'default' | 'primary' | 'secondary' | 'error'
declined: 'error',
};
const logTypeMap: Record<string, string> = {
reference: 'Rujukan',
prescription: 'Resep',
consultation: 'Konsultasi',
};
const logTypeColors: Record<string, 'default' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning'> = {
reference: 'secondary',
prescription: 'warning',
consultation: 'info',
};
export default function List() {
const [searchParams, setSearchParams] = useSearchParams();
const [providers, setProviders] = useState<any[]>([]);
@@ -266,18 +278,6 @@ export default function List() {
function Row(props: { row: any }) {
const { row } = props;
const serviceCodeMap: Record<string, string> = {
'OP': 'Outpatient',
'IP': 'Inpatient',
'DE': 'Dental',
'MA': 'Maternal',
'GL': 'Optical',
'MCU': 'Medical Check Up',
'MEDIVAC': 'Medical Emergency Evacuation',
};
const serviceName = serviceCodeMap[row.service_code] || row.service_code || '-';
return (
<TableRow>
<TableCell align="left">
@@ -287,7 +287,18 @@ export default function List() {
</TableCell>
<TableCell align="left">{row.member_name ?? '-'}</TableCell>
<TableCell align="left">{row.member_number ?? '-'}</TableCell>
<TableCell align="left">{serviceName}</TableCell>
<TableCell align="left">{row.service_code ?? '-'}</TableCell>
<TableCell align="left">
{row.log_type ? (
<Chip
label={logTypeMap[row.log_type] ?? row.log_type}
color={logTypeColors[row.log_type] ?? 'default'}
size="small"
/>
) : (
'-'
)}
</TableCell>
<TableCell align="left">{row.provider_name ?? '-'}</TableCell>
<TableCell align="left">{row.request_date ?? '-'}</TableCell>
<TableCell align="right">{fNumber(parseInt(row.amount_incurred ?? 0))}</TableCell>
@@ -362,6 +373,7 @@ export default function List() {
<TableCell style={headStyle} align="left">Nama Member</TableCell>
<TableCell style={headStyle} align="left">Member ID</TableCell>
<TableCell style={headStyle} align="left">Service</TableCell>
<TableCell style={headStyle} align="left">Tipe LOG</TableCell>
<TableCell style={headStyle} align="left">Provider</TableCell>
<TableCell style={headStyle} align="left">Tanggal Request</TableCell>
<TableCell style={headStyle} align="right">Amount Incurred</TableCell>
@@ -373,7 +385,7 @@ export default function List() {
{dataTableIsLoading ? (
<TableBody>
<TableRow>
<TableCell colSpan={10} align="center">
<TableCell colSpan={11} align="center">
Loading
</TableCell>
</TableRow>
@@ -381,7 +393,7 @@ export default function List() {
) : dataTableData.data.length === 0 ? (
<TableBody>
<TableRow>
<TableCell colSpan={10} align="center">
<TableCell colSpan={11} align="center">
No Data
</TableCell>
</TableRow>