mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +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;
|
||||
}) => {
|
||||
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='w-full'>
|
||||
<div className='overflow-x-auto'>
|
||||
<h1 className='font-bold my-4'>Kandang</h1>
|
||||
<div className='flex flex-wrap gap-2 mb-4'>
|
||||
<div className='flex flex-wrap gap-2'>
|
||||
{projectData?.kandangs?.map((kandang) => (
|
||||
<Button
|
||||
key={kandang.id}
|
||||
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}`}
|
||||
className='min-w-32'
|
||||
>
|
||||
{kandang.name}
|
||||
</Button>
|
||||
|
||||
@@ -224,15 +224,28 @@ const OverheadClosingTable = ({
|
||||
>
|
||||
{isLoadingOverhead ? (
|
||||
<OverheadClosingSkeleton columns={columns} />
|
||||
) : !isResponseSuccess(overhead) ||
|
||||
(!kandangId && overhead.data?.overheads.length === 0) ||
|
||||
(kandangId && !isResponseSuccess(overheadKandang)) ? (
|
||||
) : !isResponseSuccess(overhead) ? (
|
||||
<OverheadClosingSkeleton
|
||||
columns={columns}
|
||||
iconName='heroicons:chart-bar'
|
||||
title='Data Overhead Tidak Ditemukan'
|
||||
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>
|
||||
data={
|
||||
|
||||
Reference in New Issue
Block a user