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,7 +2414,6 @@ 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
@@ -2449,7 +2448,6 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
</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}