refactor(FE): Move expense form error alerts below fields

This commit is contained in:
rstubryan
2026-01-28 14:20:41 +07:00
parent 9f93200bd5
commit 554037bfe5
@@ -372,23 +372,6 @@ const ExpenseRequestForm = ({
onReset={formik.handleReset}
className='w-full mt-8 flex flex-col gap-6'
>
{expenseFormErrorMessage && (
<div role='alert' className='alert alert-error'>
<Icon
icon='material-symbols:error-outline'
width={24}
height={24}
/>
<span>{expenseFormErrorMessage}</span>
</div>
)}
{formErrorList.length > 0 && (
<AlertErrorList
formErrorList={formErrorList}
onClose={() => setFormErrorList([])}
/>
)}
<div className='grid grid-cols-12 gap-4'>
<SelectInput
label='Kategori'
@@ -557,6 +540,24 @@ const ExpenseRequestForm = ({
/>
</div>
{expenseFormErrorMessage && (
<div role='alert' className='alert alert-error'>
<Icon
icon='material-symbols:error-outline'
width={24}
height={24}
/>
<span>{expenseFormErrorMessage}</span>
</div>
)}
{formErrorList.length > 0 && (
<AlertErrorList
formErrorList={formErrorList}
onClose={() => setFormErrorList([])}
/>
)}
<div className='flex flex-row justify-between gap-2 flex-wrap'>
{type !== 'add' && (
<div className='flex flex-row justify-start gap-2'>