refactor(FE-170): enhance RecordingForm with approve and reject buttons for detail view

This commit is contained in:
rstubryan
2025-11-06 13:05:48 +07:00
parent fa42f9b941
commit c774480a5a
@@ -1247,6 +1247,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
<> <>
<section className='w-full'> <section className='w-full'>
<header className='flex flex-col gap-4'> <header className='flex flex-col gap-4'>
<div className='flex justify-between items-center w-full'>
<Button <Button
href='/production/recording' href='/production/recording'
variant='link' variant='link'
@@ -1255,6 +1256,34 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
<Icon icon='uil:arrow-left' width={24} height={24} /> <Icon icon='uil:arrow-left' width={24} height={24} />
Kembali Kembali
</Button> </Button>
{type === 'detail' && (
<div className='flex flex-row gap-2'>
<Button
variant='outline'
color='success'
onClick={() => approveModal.openModal()}
isLoading={isApproveLoading}
className='w-full sm:w-fit'
>
<Icon icon='material-symbols:check' width={24} height={24} />
Approve
</Button>
<Button
variant='outline'
color='error'
onClick={() => rejectModal.openModal()}
isLoading={isRejectLoading}
className='w-full sm:w-fit'
>
<Icon icon='material-symbols:close' width={24} height={24} />
Reject
</Button>
</div>
)}
</div>
<h1 className='text-2xl font-bold text-center'> <h1 className='text-2xl font-bold text-center'>
{type === 'add' && 'Tambah Recording'} {type === 'add' && 'Tambah Recording'}
{type === 'edit' && 'Edit Recording'} {type === 'edit' && 'Edit Recording'}
@@ -2346,40 +2375,6 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
Edit Edit
</Button> </Button>
)} )}
{type === 'detail' && (
<>
<Button
type='button'
color='success'
onClick={() => approveModal.openModal()}
className='px-4'
isLoading={isApproveLoading}
>
<Icon
icon='material-symbols:check-circle-outline'
width={24}
height={24}
className='justify-start text-sm'
/>
Approve
</Button>
<Button
type='button'
color='error'
onClick={() => rejectModal.openModal()}
className='px-4'
isLoading={isRejectLoading}
>
<Icon
icon='material-symbols:cancel-outline'
width={24}
height={24}
className='justify-start text-sm'
/>
Reject
</Button>
</>
)}
</div> </div>
)} )}
{type !== 'detail' && ( {type !== 'detail' && (