mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-25 07:45:47 +00:00
refactor(FE): Use StatusBadge instead of PillBadge
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import PillBadge from '@/components/PillBadge';
|
||||
import StatusBadge from '@/components/helper/StatusBadge';
|
||||
|
||||
import { BaseApproval } from '@/types/api/api-general';
|
||||
import { Color } from '@/types/theme';
|
||||
|
||||
interface RealizationStatusBadgeProps {
|
||||
approval?: BaseApproval;
|
||||
@@ -15,23 +16,21 @@ const RealizationStatusBadge = ({ approval }: RealizationStatusBadgeProps) => {
|
||||
? 'Sudah Realisasi'
|
||||
: 'Belum Realisasi';
|
||||
|
||||
let realizationStatusPillBadgeColor:
|
||||
| 'yellow'
|
||||
| 'green'
|
||||
| 'gray'
|
||||
| 'red'
|
||||
| 'purple'
|
||||
| 'blue' = isExpenseRealized ? 'green' : 'yellow';
|
||||
let realizationStatusBadgeColor: Color = isExpenseRealized
|
||||
? 'success'
|
||||
: 'warning';
|
||||
|
||||
if (isLatestApprovalRejected) {
|
||||
realizationStatusPillBadgeColor = 'red';
|
||||
realizationStatusBadgeColor = 'error';
|
||||
}
|
||||
|
||||
return (
|
||||
<PillBadge
|
||||
content={isLatestApprovalRejected ? 'Ditolak' : realizationStatus}
|
||||
color={realizationStatusPillBadgeColor}
|
||||
className='text-xs'
|
||||
<StatusBadge
|
||||
color={realizationStatusBadgeColor}
|
||||
text={isLatestApprovalRejected ? 'Ditolak' : realizationStatus}
|
||||
className={{
|
||||
badge: 'w-fit',
|
||||
}}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user