mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-25 15:55:48 +00:00
refactor(FE): Refactor RecordingTable layout for improved readability
This commit is contained in:
@@ -2,7 +2,7 @@ import RecordingTable from '@/components/pages/production/recording/RecordingTab
|
|||||||
|
|
||||||
const Recording = () => {
|
const Recording = () => {
|
||||||
return (
|
return (
|
||||||
<section className='w-full p-3 overflow-x-hidden'>
|
<section className='w-full overflow-x-hidden'>
|
||||||
<RecordingTable />
|
<RecordingTable />
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1173,11 +1173,9 @@ const RecordingTable = () => {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className='w-full'>
|
<div className='w-full'>
|
||||||
<div className='flex flex-col mb-4 -mx-4 px-4'>
|
<div className='w-full p-3 flex flex-row justify-between gap-3 flex-wrap border-b border-base-content/10'>
|
||||||
{/* Action Buttons, Search and Filter Section */}
|
|
||||||
<div className='relative w-full p-3 pt-0 px-0 flex flex-col xl:flex-row justify-between items-start xl:items-center gap-3 flex-wrap after:absolute after:bottom-0 after:left-0 after:right-0 after:-mx-4 after:border-b after:border-base-content/10'>
|
|
||||||
{/* Action Buttons */}
|
{/* Action Buttons */}
|
||||||
<div className='w-full xl:w-fit flex flex-col sm:flex-row self-start gap-2'>
|
<div className='w-fit flex flex-row gap-3 flex-wrap'>
|
||||||
<RequirePermission permissions='lti.production.recording.create'>
|
<RequirePermission permissions='lti.production.recording.create'>
|
||||||
<Button
|
<Button
|
||||||
href='/production/recording/add'
|
href='/production/recording/add'
|
||||||
@@ -1191,49 +1189,51 @@ const RecordingTable = () => {
|
|||||||
|
|
||||||
{selectedRowIds.length > 0 && (
|
{selectedRowIds.length > 0 && (
|
||||||
<>
|
<>
|
||||||
|
<hr className='w-px h-full border-none bg-base-content/10 sm:block hidden' />
|
||||||
|
|
||||||
<RequirePermission permissions='lti.production.recording.approve'>
|
<RequirePermission permissions='lti.production.recording.approve'>
|
||||||
<Button
|
<Button
|
||||||
variant='outline'
|
variant='outline'
|
||||||
color='success'
|
color='none'
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setApprovalNotes('');
|
setApprovalNotes('');
|
||||||
approveModal.openModal();
|
rejectModal.openModal();
|
||||||
}}
|
}}
|
||||||
disabled={
|
disabled={
|
||||||
selectedRowIds.length === 0 ||
|
selectedRowIds.length === 0 || eligibleRowIds.length === 0
|
||||||
eligibleRowIds.length === 0
|
|
||||||
}
|
}
|
||||||
className='w-full sm:w-fit'
|
className='px-3 py-2.5 gap-1.5 text-sm text-base-content/50 border border-base-content/10 rounded-xl shadow-button-soft'
|
||||||
>
|
>
|
||||||
<Icon
|
<Icon
|
||||||
icon='material-symbols:check'
|
icon='heroicons:x-mark'
|
||||||
width={24}
|
width={20}
|
||||||
height={24}
|
height={20}
|
||||||
|
className='text-error'
|
||||||
/>
|
/>
|
||||||
Approve
|
Reject
|
||||||
</Button>
|
</Button>
|
||||||
</RequirePermission>
|
</RequirePermission>
|
||||||
|
|
||||||
<RequirePermission permissions='lti.production.recording.approve'>
|
<RequirePermission permissions='lti.production.recording.approve'>
|
||||||
<Button
|
<Button
|
||||||
variant='outline'
|
variant='outline'
|
||||||
color='error'
|
color='none'
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setApprovalNotes('');
|
setApprovalNotes('');
|
||||||
rejectModal.openModal();
|
approveModal.openModal();
|
||||||
}}
|
}}
|
||||||
disabled={
|
disabled={
|
||||||
selectedRowIds.length === 0 ||
|
selectedRowIds.length === 0 || eligibleRowIds.length === 0
|
||||||
eligibleRowIds.length === 0
|
|
||||||
}
|
}
|
||||||
className='w-full sm:w-fit'
|
className='px-3 py-2.5 gap-1.5 text-sm text-base-content/50 border border-base-content/10 rounded-xl shadow-button-soft'
|
||||||
>
|
>
|
||||||
<Icon
|
<Icon
|
||||||
icon='material-symbols:close'
|
icon='heroicons:check'
|
||||||
width={24}
|
width={20}
|
||||||
height={24}
|
height={20}
|
||||||
|
className='text-success'
|
||||||
/>
|
/>
|
||||||
Reject
|
Approve
|
||||||
</Button>
|
</Button>
|
||||||
</RequirePermission>
|
</RequirePermission>
|
||||||
</>
|
</>
|
||||||
@@ -1241,7 +1241,7 @@ const RecordingTable = () => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Search and Filter */}
|
{/* Search and Filter */}
|
||||||
<div className='flex flex-1 flex-row justify-start sm:justify-end items-center gap-3 flex-wrap w-full xl:w-auto'>
|
<div className='flex flex-1 flex-row justify-start sm:justify-end items-center gap-3 flex-wrap'>
|
||||||
<DebouncedTextInput
|
<DebouncedTextInput
|
||||||
name='search'
|
name='search'
|
||||||
placeholder='Search'
|
placeholder='Search'
|
||||||
@@ -1298,6 +1298,7 @@ const RecordingTable = () => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Table Section */}
|
{/* Table Section */}
|
||||||
|
<div className='flex flex-col mb-4 -mx-4 px-4'>
|
||||||
{isLoading ? (
|
{isLoading ? (
|
||||||
<div className='w-full flex flex-row justify-center items-center p-4'>
|
<div className='w-full flex flex-row justify-center items-center p-4'>
|
||||||
<span className='loading loading-spinner loading-xl' />
|
<span className='loading loading-spinner loading-xl' />
|
||||||
@@ -1335,7 +1336,7 @@ const RecordingTable = () => {
|
|||||||
rowSelection={rowSelection}
|
rowSelection={rowSelection}
|
||||||
setRowSelection={setRowSelection}
|
setRowSelection={setRowSelection}
|
||||||
className={{
|
className={{
|
||||||
containerClassName: cn('mt-3 mb-0', {
|
containerClassName: cn('p-3 mb-0', {
|
||||||
'w-full':
|
'w-full':
|
||||||
isResponseSuccess(recordings) &&
|
isResponseSuccess(recordings) &&
|
||||||
recordings?.data?.length === 0,
|
recordings?.data?.length === 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user