refactor(FE): Replace Badge with simple span and rename adornment prop

This commit is contained in:
rstubryan
2026-01-29 11:09:30 +07:00
parent 079d69dffb
commit 75dfd96934
@@ -1125,16 +1125,9 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
}
return (
<Badge
variant='soft'
color={color}
size='sm'
className={{
badge: 'whitespace-nowrap font-semibold text-xs px-2',
}}
>
<span className={'whitespace-nowrap text-xs'}>
Periode {projectFlockKandangLookup.project_flock?.period}
</Badge>
</span>
);
}, [recordedProjectFlockKandangIds, projectFlockKandangLookup]);
@@ -1150,33 +1143,11 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
const hasOvkFlag = productWarehouse.product.flags?.includes('OVK');
if (hasPakanFlag) {
return (
<Badge
variant='soft'
color='info'
size='sm'
className={{
badge: 'whitespace-nowrap font-semibold text-xs px-2',
}}
>
PAKAN
</Badge>
);
return <span className={'whitespace-nowrap text-xs'}>PAKAN</span>;
}
if (hasOvkFlag) {
return (
<Badge
variant='soft'
color='secondary'
size='sm'
className={{
badge: 'whitespace-nowrap font-semibold text-xs px-2',
}}
>
OVK
</Badge>
);
return <span className={'whitespace-nowrap text-xs'}>OVK</span>;
}
return null;
@@ -1826,7 +1797,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
Boolean(formik.errors.kandang_id)
}
errorMessage={formik.errors.kandang_id as string}
startAdornment={
inputPrefix={
projectFlockKandangLookup || projectFlockKandangDetail
? getProjectFlockBadgeAdornment()
: undefined
@@ -2458,7 +2429,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
!formik.values.project_flock_kandang_id
}
isClearable={type !== 'detail'}
startAdornment={
inputPrefix={
stock.product_warehouse_id
? getProductFlagBadgeAdornment(
stock.product_warehouse_id