mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-23 14:55:44 +00:00
refactor(FE): Refactor UI and improve conditional rendering in closing
pages
This commit is contained in:
@@ -10,18 +10,17 @@ const ClosingKandangList = ({
|
|||||||
projectData?: ProjectFlock;
|
projectData?: ProjectFlock;
|
||||||
}) => {
|
}) => {
|
||||||
return (
|
return (
|
||||||
<div className='w-full my-4 @container'>
|
<div className='w-full py-3 @container relative before:absolute before:top-0 before:left-0 before:right-0 before:-mx-4 before:border-t before:border-base-content/10 after:absolute after:bottom-0 after:left-0 after:right-0 after:-mx-4 after:border-b after:border-base-content/10'>
|
||||||
<div className='flex flex-col @sm:flex-row gap-4'>
|
<div className='flex flex-col @sm:flex-row gap-4'>
|
||||||
<div className='w-full'>
|
<div className='w-full'>
|
||||||
<div className='overflow-x-auto'>
|
<div className='overflow-x-auto'>
|
||||||
<h1 className='font-bold my-4'>Kandang</h1>
|
<div className='flex flex-wrap gap-2'>
|
||||||
<div className='flex flex-wrap gap-2 mb-4'>
|
|
||||||
{projectData?.kandangs?.map((kandang) => (
|
{projectData?.kandangs?.map((kandang) => (
|
||||||
<Button
|
<Button
|
||||||
key={kandang.id}
|
key={kandang.id}
|
||||||
variant='outline'
|
variant='outline'
|
||||||
|
className='px-3 py-2.5 w-fit text-sm rounded-lg shadow-sm'
|
||||||
href={`/closing/detail/?closingId=${initialValue?.flock_id}&kandangId=${kandang.project_flock_kandang_id}`}
|
href={`/closing/detail/?closingId=${initialValue?.flock_id}&kandangId=${kandang.project_flock_kandang_id}`}
|
||||||
className='min-w-32'
|
|
||||||
>
|
>
|
||||||
{kandang.name}
|
{kandang.name}
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -224,15 +224,28 @@ const OverheadClosingTable = ({
|
|||||||
>
|
>
|
||||||
{isLoadingOverhead ? (
|
{isLoadingOverhead ? (
|
||||||
<OverheadClosingSkeleton columns={columns} />
|
<OverheadClosingSkeleton columns={columns} />
|
||||||
) : !isResponseSuccess(overhead) ||
|
) : !isResponseSuccess(overhead) ? (
|
||||||
(!kandangId && overhead.data?.overheads.length === 0) ||
|
|
||||||
(kandangId && !isResponseSuccess(overheadKandang)) ? (
|
|
||||||
<OverheadClosingSkeleton
|
<OverheadClosingSkeleton
|
||||||
columns={columns}
|
columns={columns}
|
||||||
iconName='heroicons:chart-bar'
|
iconName='heroicons:chart-bar'
|
||||||
title='Data Overhead Tidak Ditemukan'
|
title='Data Overhead Tidak Ditemukan'
|
||||||
subtitle='Tidak ada data overhead untuk periode ini.'
|
subtitle='Tidak ada data overhead untuk periode ini.'
|
||||||
/>
|
/>
|
||||||
|
) : kandangId && !isResponseSuccess(overheadKandang) ? (
|
||||||
|
<OverheadClosingSkeleton
|
||||||
|
columns={columns}
|
||||||
|
iconName='heroicons:chart-bar'
|
||||||
|
title='Data Overhead Tidak Ditemukan'
|
||||||
|
subtitle='Tidak ada data overhead untuk periode ini.'
|
||||||
|
/>
|
||||||
|
) : (!kandangId && overhead.data?.overheads.length === 0) ||
|
||||||
|
(kandangId &&
|
||||||
|
isResponseSuccess(overheadKandang) &&
|
||||||
|
overheadKandang.data?.overheads.length === 0) ? (
|
||||||
|
<OverheadClosingSkeleton
|
||||||
|
columns={columns}
|
||||||
|
iconName='heroicons:chart-bar'
|
||||||
|
/>
|
||||||
) : (
|
) : (
|
||||||
<Table<Overhead>
|
<Table<Overhead>
|
||||||
data={
|
data={
|
||||||
|
|||||||
Reference in New Issue
Block a user