mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-23 14:55:44 +00:00
refactor(FE): Replace Badge with simple span and rename adornment prop
This commit is contained in:
@@ -1125,16 +1125,9 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Badge
|
<span className={'whitespace-nowrap text-xs'}>
|
||||||
variant='soft'
|
|
||||||
color={color}
|
|
||||||
size='sm'
|
|
||||||
className={{
|
|
||||||
badge: 'whitespace-nowrap font-semibold text-xs px-2',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Periode {projectFlockKandangLookup.project_flock?.period}
|
Periode {projectFlockKandangLookup.project_flock?.period}
|
||||||
</Badge>
|
</span>
|
||||||
);
|
);
|
||||||
}, [recordedProjectFlockKandangIds, projectFlockKandangLookup]);
|
}, [recordedProjectFlockKandangIds, projectFlockKandangLookup]);
|
||||||
|
|
||||||
@@ -1150,33 +1143,11 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
|||||||
const hasOvkFlag = productWarehouse.product.flags?.includes('OVK');
|
const hasOvkFlag = productWarehouse.product.flags?.includes('OVK');
|
||||||
|
|
||||||
if (hasPakanFlag) {
|
if (hasPakanFlag) {
|
||||||
return (
|
return <span className={'whitespace-nowrap text-xs'}>PAKAN</span>;
|
||||||
<Badge
|
|
||||||
variant='soft'
|
|
||||||
color='info'
|
|
||||||
size='sm'
|
|
||||||
className={{
|
|
||||||
badge: 'whitespace-nowrap font-semibold text-xs px-2',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
PAKAN
|
|
||||||
</Badge>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasOvkFlag) {
|
if (hasOvkFlag) {
|
||||||
return (
|
return <span className={'whitespace-nowrap text-xs'}>OVK</span>;
|
||||||
<Badge
|
|
||||||
variant='soft'
|
|
||||||
color='secondary'
|
|
||||||
size='sm'
|
|
||||||
className={{
|
|
||||||
badge: 'whitespace-nowrap font-semibold text-xs px-2',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
OVK
|
|
||||||
</Badge>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
@@ -1826,7 +1797,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
|||||||
Boolean(formik.errors.kandang_id)
|
Boolean(formik.errors.kandang_id)
|
||||||
}
|
}
|
||||||
errorMessage={formik.errors.kandang_id as string}
|
errorMessage={formik.errors.kandang_id as string}
|
||||||
startAdornment={
|
inputPrefix={
|
||||||
projectFlockKandangLookup || projectFlockKandangDetail
|
projectFlockKandangLookup || projectFlockKandangDetail
|
||||||
? getProjectFlockBadgeAdornment()
|
? getProjectFlockBadgeAdornment()
|
||||||
: undefined
|
: undefined
|
||||||
@@ -2458,7 +2429,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
|||||||
!formik.values.project_flock_kandang_id
|
!formik.values.project_flock_kandang_id
|
||||||
}
|
}
|
||||||
isClearable={type !== 'detail'}
|
isClearable={type !== 'detail'}
|
||||||
startAdornment={
|
inputPrefix={
|
||||||
stock.product_warehouse_id
|
stock.product_warehouse_id
|
||||||
? getProductFlagBadgeAdornment(
|
? getProductFlagBadgeAdornment(
|
||||||
stock.product_warehouse_id
|
stock.product_warehouse_id
|
||||||
|
|||||||
Reference in New Issue
Block a user