mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
feat(FE-170): simplify action buttons in RecordingForm for detail view
This commit is contained in:
@@ -2414,42 +2414,40 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
||||
{/* Action buttons */}
|
||||
<div className='flex flex-row justify-between gap-2 flex-wrap'>
|
||||
{/* Left side - Detail & Edit actions */}
|
||||
{type !== 'add' && !isRecordingApproved(initialValues) && (
|
||||
<div className='flex flex-row justify-start gap-2'>
|
||||
{type === 'detail' && deleteRecordingClickHandler && (
|
||||
<Button
|
||||
type='button'
|
||||
color='error'
|
||||
onClick={deleteRecordingClickHandler}
|
||||
className='px-4'
|
||||
>
|
||||
<Icon
|
||||
icon='material-symbols:delete-outline-rounded'
|
||||
width={24}
|
||||
height={24}
|
||||
className='justify-start text-sm'
|
||||
/>
|
||||
Delete
|
||||
</Button>
|
||||
)}
|
||||
{type === 'detail' && initialValues && (
|
||||
<Button
|
||||
type='button'
|
||||
color='warning'
|
||||
href={`/production/recording/detail/edit/?recordingId=${initialValues.id}`}
|
||||
className='px-4'
|
||||
>
|
||||
<Icon
|
||||
icon='material-symbols:edit-outline'
|
||||
width={24}
|
||||
height={24}
|
||||
className='justify-start text-sm'
|
||||
/>
|
||||
Edit
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
<div className='flex flex-row justify-start gap-2'>
|
||||
{type === 'detail' && deleteRecordingClickHandler && (
|
||||
<Button
|
||||
type='button'
|
||||
color='error'
|
||||
onClick={deleteRecordingClickHandler}
|
||||
className='px-4'
|
||||
>
|
||||
<Icon
|
||||
icon='material-symbols:delete-outline-rounded'
|
||||
width={24}
|
||||
height={24}
|
||||
className='justify-start text-sm'
|
||||
/>
|
||||
Delete
|
||||
</Button>
|
||||
)}
|
||||
{type === 'detail' && initialValues && (
|
||||
<Button
|
||||
type='button'
|
||||
color='warning'
|
||||
href={`/production/recording/detail/edit/?recordingId=${initialValues.id}`}
|
||||
className='px-4'
|
||||
>
|
||||
<Icon
|
||||
icon='material-symbols:edit-outline'
|
||||
width={24}
|
||||
height={24}
|
||||
className='justify-start text-sm'
|
||||
/>
|
||||
Edit
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
<div className='flex flex-row justify-end gap-2'>
|
||||
{type === 'detail' && isLayingCategory && (
|
||||
<Button
|
||||
@@ -2494,7 +2492,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
||||
<>
|
||||
<Button
|
||||
type='reset'
|
||||
color='neutral'
|
||||
color='warning'
|
||||
className='px-4'
|
||||
onClick={(e) => {
|
||||
formik.handleReset(e);
|
||||
@@ -2569,7 +2567,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
||||
</section>
|
||||
|
||||
{/* ===== MODALS ===== */}
|
||||
{type !== 'add' && !isRecordingApproved(initialValues) && (
|
||||
{type === 'detail' && (
|
||||
<>
|
||||
<ConfirmationModal
|
||||
ref={deleteModal.ref}
|
||||
|
||||
Reference in New Issue
Block a user