feat(FE-170): simplify action buttons in RecordingForm for detail view

This commit is contained in:
rstubryan
2025-11-06 17:47:34 +07:00
parent b24c9d8336
commit b39e8325f8
@@ -2414,42 +2414,40 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
{/* Action buttons */} {/* Action buttons */}
<div className='flex flex-row justify-between gap-2 flex-wrap'> <div className='flex flex-row justify-between gap-2 flex-wrap'>
{/* Left side - Detail & Edit actions */} {/* Left side - Detail & Edit actions */}
{type !== 'add' && !isRecordingApproved(initialValues) && ( <div className='flex flex-row justify-start gap-2'>
<div className='flex flex-row justify-start gap-2'> {type === 'detail' && deleteRecordingClickHandler && (
{type === 'detail' && deleteRecordingClickHandler && ( <Button
<Button type='button'
type='button' color='error'
color='error' onClick={deleteRecordingClickHandler}
onClick={deleteRecordingClickHandler} className='px-4'
className='px-4' >
> <Icon
<Icon icon='material-symbols:delete-outline-rounded'
icon='material-symbols:delete-outline-rounded' width={24}
width={24} height={24}
height={24} className='justify-start text-sm'
className='justify-start text-sm' />
/> Delete
Delete </Button>
</Button> )}
)} {type === 'detail' && initialValues && (
{type === 'detail' && initialValues && ( <Button
<Button type='button'
type='button' color='warning'
color='warning' href={`/production/recording/detail/edit/?recordingId=${initialValues.id}`}
href={`/production/recording/detail/edit/?recordingId=${initialValues.id}`} className='px-4'
className='px-4' >
> <Icon
<Icon icon='material-symbols:edit-outline'
icon='material-symbols:edit-outline' width={24}
width={24} height={24}
height={24} className='justify-start text-sm'
className='justify-start text-sm' />
/> Edit
Edit </Button>
</Button> )}
)} </div>
</div>
)}
<div className='flex flex-row justify-end gap-2'> <div className='flex flex-row justify-end gap-2'>
{type === 'detail' && isLayingCategory && ( {type === 'detail' && isLayingCategory && (
<Button <Button
@@ -2494,7 +2492,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
<> <>
<Button <Button
type='reset' type='reset'
color='neutral' color='warning'
className='px-4' className='px-4'
onClick={(e) => { onClick={(e) => {
formik.handleReset(e); formik.handleReset(e);
@@ -2569,7 +2567,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
</section> </section>
{/* ===== MODALS ===== */} {/* ===== MODALS ===== */}
{type !== 'add' && !isRecordingApproved(initialValues) && ( {type === 'detail' && (
<> <>
<ConfirmationModal <ConfirmationModal
ref={deleteModal.ref} ref={deleteModal.ref}