tambah listing file di client portal

This commit is contained in:
2024-02-05 16:57:52 +07:00
parent a9c14088c6
commit b9a9b53918
4 changed files with 163 additions and 1 deletions

View File

@@ -129,6 +129,23 @@ type ServiceMonitoringProps = {
mainDiagnose: string;
comparativeDiagnosis: string;
serviceName: string;
files: {
result: {
type: string;
original_name: string;
url: string;
}[];
diagnosis: {
type: string;
original_name: string;
url: string;
}[];
kondisi: {
type: string;
original_name: string;
url: string;
}[];
};
benefits: {
amountIncurred: number;
amountApproved: number;
@@ -439,6 +456,122 @@ export default function ServiceMonitoring() {
</Typography>
</Grid>
</Grid>
<Grid item container xs={12} spacing={1.5}>
<Grid item xs={12}>
<Typography variant="subtitle2" color={'grey.600'}>
{loading ? (
<Skeleton animation={'wave'} width={200} />
) : (
'Files Result'
)}
</Typography>
</Grid>
<Grid item>
{loading ? (
<Skeleton animation="wave" width={300} />
) : data && data.files && data.files.result.length > 0 ?
(
data.files.result.map((file, index) =>
(
(
<Stack direction="column" spacing={2} key={index}>
<Stack direction="row" spacing={1} sx={{color: '#19BBBB'}}>
<a
href={file.url}
download={file.original_name ? file.original_name : 'test'}
style={{ cursor: 'pointer', textDecoration: 'none', color: '#19BBBB' }}
target="_blank"
>
<Typography variant="body2" gutterBottom>{file.original_name ? file.original_name : '-'}</Typography>
</a>
</Stack>
</Stack>
)
)
)
) : (
<Typography variant="subtitle1" color={'grey.800'}>
-
</Typography>
)}
</Grid>
<Grid item xs={12}>
<Typography variant="subtitle2" color={'grey.600'}>
{loading ? (
<Skeleton animation={'wave'} width={200} />
) : (
'Files Diagnosis'
)}
</Typography>
</Grid>
<Grid item>
{loading ? (
<Skeleton animation="wave" width={300} />
) : data && data.files && data.files.diagnosis.length > 0 ?
(
data.files.diagnosis.map((file, index) =>
(
(
<Stack direction="column" spacing={2} key={index}>
<Stack direction="row" spacing={1} sx={{color: '#19BBBB'}}>
<a
href={file.url}
download={file.original_name ? file.original_name : 'test'}
style={{ cursor: 'pointer', textDecoration: 'none', color: '#19BBBB' }}
target="_blank"
>
<Typography variant="body2" gutterBottom>{file.original_name ? file.original_name : '-'}</Typography>
</a>
</Stack>
</Stack>
)
)
)
) : (
<Typography variant="subtitle1" color={'grey.800'}>
-
</Typography>
)}
</Grid>
<Grid item xs={12}>
<Typography variant="subtitle2" color={'grey.600'}>
{loading ? (
<Skeleton animation={'wave'} width={200} />
) : (
'Files Kondisi'
)}
</Typography>
</Grid>
<Grid item>
{loading ? (
<Skeleton animation="wave" width={300} />
) : data && data.files && data.files.kondisi.length > 0 ?
(
data.files.kondisi.map((file, index) =>
(
(
<Stack direction="column" spacing={2} key={index}>
<Stack direction="row" spacing={1} sx={{color: '#19BBBB'}}>
<a
href={file.url}
style={{ cursor: 'pointer', textDecoration: 'none', color: '#19BBBB' }}
target="_blank"
>
<Typography variant="body2" gutterBottom>{file.original_name ? file.original_name : '-'}</Typography>
</a>
</Stack>
</Stack>
)
)
)
) : (
<Typography variant="subtitle1" color={'grey.800'}>
-
</Typography>
)}
</Grid>
</Grid>
</Grid>
</Grid>
</Card>