refactor(FE): change number input to reuseablecomponent from ui-component

This commit is contained in:
randy-ar
2025-10-27 13:03:38 +07:00
parent 4bd6fe8c35
commit 6706f361d8
3 changed files with 42 additions and 423 deletions
@@ -1377,9 +1377,6 @@ const MovementForm = ({ type = 'add', initialValues }: MovementFormProps) => {
handleDeliveryCostChange(idx, e.target.value)
}
onBlur={formik.handleBlur}
maskType='currency'
decimals={0}
min={0}
{...isRepeaterInputError(
'deliveries',
'delivery_cost',
@@ -1404,9 +1401,6 @@ const MovementForm = ({ type = 'add', initialValues }: MovementFormProps) => {
)
}
onBlur={formik.handleBlur}
maskType='currency'
decimals={0}
min={0}
{...isRepeaterInputError(
'deliveries',
'delivery_cost_per_item',
@@ -942,9 +942,6 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
value={feed.feed_stock}
onChange={handleFeedStockChangeWrapper(idx)}
onBlur={formik.handleBlur}
maskType='number'
decimals={0}
min={0}
thousandSeparator=','
decimalSeparator=''
isError={
@@ -1120,10 +1117,6 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
value={weight.chicken_weight}
onChange={handleChickenWeightChangeWrapper(idx)}
onBlur={formik.handleBlur}
maskType='weight'
weightUnit='gram'
decimals={2}
min={0}
thousandSeparator=','
decimalSeparator='.'
isError={
@@ -1153,9 +1146,6 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
value={weight.chicken_count}
onChange={handleChickenCountChangeWrapper(idx)}
onBlur={formik.handleBlur}
maskType='number'
decimals={0}
min={0}
isError={
isRepeaterInputError(
'body_weight',
@@ -1184,10 +1174,6 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
value={weight.average_chicken_weight || ''}
onChange={handleAverageWeightChangeWrapper(idx)}
onBlur={formik.handleBlur}
maskType='weight'
weightUnit='gram'
decimals={2}
min={0}
thousandSeparator=','
decimalSeparator='.'
isError={
@@ -1450,9 +1436,6 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
value={vaccine.used_stock}
onChange={handleVaccinationStockChangeWrapper(idx)}
onBlur={formik.handleBlur}
maskType='number'
decimals={0}
min={0}
thousandSeparator=','
decimalSeparator=''
isError={
@@ -1660,9 +1643,6 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
value={mortality.count}
onChange={handleMortalityCountChangeWrapper(idx)}
onBlur={formik.handleBlur}
maskType='number'
decimals={0}
min={0}
thousandSeparator=','
decimalSeparator=''
isError={