refactor(FE): Move form error alerts to bottom of forms

This commit is contained in:
rstubryan
2026-01-28 14:14:44 +07:00
parent 70fcbf795b
commit 9f93200bd5
8 changed files with 154 additions and 137 deletions
@@ -1263,25 +1263,6 @@ const MovementForm = ({ type = 'add', initialValues }: MovementFormProps) => {
onReset={formik.handleReset}
className='w-full mt-8 flex flex-col gap-6'
>
{movementFormErrorMessage && (
<div role='alert' className='alert alert-error'>
<Icon
icon='material-symbols:error-outline'
width={24}
height={24}
/>
<span>{movementFormErrorMessage}</span>
</div>
)}
{/* Error List Alert */}
{formErrorList.length > 0 && (
<AlertErrorList
formErrorList={formErrorList}
onClose={() => setFormErrorList([])}
/>
)}
{/* Top card - Movement details */}
<Card
title='Detail Movement'
@@ -2007,6 +1988,27 @@ const MovementForm = ({ type = 'add', initialValues }: MovementFormProps) => {
)}
</Card>
<div className='w-full'>
{movementFormErrorMessage && (
<div role='alert' className='alert alert-error'>
<Icon
icon='material-symbols:error-outline'
width={24}
height={24}
/>
<span>{movementFormErrorMessage}</span>
</div>
)}
{/* Error List Alert */}
{formErrorList.length > 0 && (
<AlertErrorList
formErrorList={formErrorList}
onClose={() => setFormErrorList([])}
/>
)}
</div>
{/* Action buttons */}
<div className='flex flex-row justify-between gap-2 flex-wrap'>
{type !== 'detail' && (