refactor(FE-318): Add egg weight column and separate inputs

This commit is contained in:
rstubryan
2025-12-08 20:08:35 +07:00
parent b464432581
commit 5deca5739f
@@ -2599,6 +2599,15 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
<span className='text-error'>*</span> <span className='text-error'>*</span>
</span> </span>
</th> </th>
<th>
Berat (gram)
<span
className='tooltip tooltip-error tooltip-bottom '
data-tip='required'
>
<span className='text-error'>*</span>
</span>
</th>
{(type as 'add' | 'edit' | 'detail') !== 'detail' && ( {(type as 'add' | 'edit' | 'detail') !== 'detail' && (
<th>Action</th> <th>Action</th>
)} )}
@@ -2674,7 +2683,6 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
/> />
</td> </td>
<td> <td>
<div className='flex flex-col gap-1'>
<NumberInput <NumberInput
required required
name={`eggs.${idx}.qty`} name={`eggs.${idx}.qty`}
@@ -2686,8 +2694,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
thousandSeparator=',' thousandSeparator=','
decimalSeparator='.' decimalSeparator='.'
isError={ isError={
isRepeaterInputError('eggs', 'qty', idx) isRepeaterInputError('eggs', 'qty', idx).isError
.isError
} }
errorMessage={ errorMessage={
isRepeaterInputError('eggs', 'qty', idx) isRepeaterInputError('eggs', 'qty', idx)
@@ -2699,8 +2706,8 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
}} }}
placeholder='Masukkan jumlah telur' placeholder='Masukkan jumlah telur'
/> />
</div> </td>
<div className='flex flex-col gap-1'> <td>
<NumberInput <NumberInput
required required
name={`eggs.${idx}.weight`} name={`eggs.${idx}.weight`}
@@ -2725,7 +2732,6 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
}} }}
placeholder='Masukkan berat telur (gram)...' placeholder='Masukkan berat telur (gram)...'
/> />
</div>
</td> </td>
{(type as 'add' | 'edit' | 'detail') !== 'detail' && ( {(type as 'add' | 'edit' | 'detail') !== 'detail' && (
<td> <td>
@@ -2908,7 +2914,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
> >
Submit Submit
</Button> </Button>
{isLayingCategory && ( {/*{isLayingCategory && (
<Tooltip <Tooltip
content={ content={
hasConsumableEggs hasConsumableEggs
@@ -2979,7 +2985,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
Next Step: Grading Next Step: Grading
</Button> </Button>
</Tooltip> </Tooltip>
)} )}*/}
</div> </div>
)} )}
</div> </div>