mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 05:22:02 +00:00
refactor(FE): Refactor component and file names for consistency
This commit is contained in:
@@ -6,19 +6,19 @@ import { Icon } from '@iconify/react';
|
||||
import Button from '@/components/Button';
|
||||
import Tabs from '@/components/Tabs';
|
||||
import ClosingGeneralInformationTable from '@/components/pages/closing/ClosingGeneralInformationTable';
|
||||
import ClosingSapronakTabContent from '@/components/pages/closing/tab/ClosingSapronakTabContent';
|
||||
import ClosingProductionDataTabContent from '@/components/pages/closing/tab/ClosingProductionDataTabContent';
|
||||
import SapronakClosingTab from '@/components/pages/closing/tab/SapronakClosingTab';
|
||||
import ProductionDataClosingTab from '@/components/pages/closing/tab/ProductionDataClosingTab';
|
||||
|
||||
import {
|
||||
ClosingGeneralInformation,
|
||||
BaseClosingSales,
|
||||
ClosingHppExpedition,
|
||||
} from '@/types/api/closing';
|
||||
import ClosingSapronakCalculationTabContent from '@/components/pages/closing/tab/ClosingSapronakCalculationTabContent';
|
||||
import ClosingOverheadTabContent from '@/components/pages/closing/tab/ClosingOverheadTabContent';
|
||||
import ClosingFinanceTabContent from '@/components/pages/closing/tab/ClosingFinanceTabContent';
|
||||
import SalesReportTable from '@/components/pages/closing/table/SalesReportTable';
|
||||
import HppExpeditionReportTable from './table/HppExpeditionReportTable';
|
||||
import SapronakCalculationClosingTab from '@/components/pages/closing/tab/SapronakCalculationClosingTab';
|
||||
import OverheadClosingTab from '@/components/pages/closing/tab/OverheadClosingTab';
|
||||
import FinanceClosingTab from '@/components/pages/closing/tab/FinanceClosingTab';
|
||||
import SalesClosingTable from '@/components/pages/closing/table/SalesClosingTable';
|
||||
import HppExpeditionClosingTable from './table/HppExpeditionClosingTable';
|
||||
import ClosingKandangList from '@/components/pages/closing/ClosingKandangList';
|
||||
import { ProjectFlock } from '@/types/api/production/project-flock';
|
||||
import { ProjectFlockKandang } from '@/types/api/production/project-flock-kandang';
|
||||
@@ -46,13 +46,13 @@ const ClosingDetail: React.FC<ClosingDetailProps> = ({
|
||||
{
|
||||
id: 'sapronak',
|
||||
label: 'Sapronak',
|
||||
content: <ClosingSapronakTabContent projectFlockId={id} />,
|
||||
content: <SapronakClosingTab projectFlockId={id} />,
|
||||
},
|
||||
{
|
||||
id: 'perhitunganSapronak',
|
||||
label: 'Perhitungan Sapronak',
|
||||
content: (
|
||||
<ClosingSapronakCalculationTabContent
|
||||
<SapronakCalculationClosingTab
|
||||
closingGeneralInformation={initialValue}
|
||||
projectFlockId={id}
|
||||
/>
|
||||
@@ -61,13 +61,13 @@ const ClosingDetail: React.FC<ClosingDetailProps> = ({
|
||||
{
|
||||
id: 'penjualan',
|
||||
label: 'Penjualan',
|
||||
content: <SalesReportTable initialValues={salesData} />,
|
||||
content: <SalesClosingTable initialValues={salesData} />,
|
||||
},
|
||||
{
|
||||
id: 'overhead',
|
||||
label: 'Overhead',
|
||||
content: (
|
||||
<ClosingOverheadTabContent
|
||||
<OverheadClosingTab
|
||||
projectFlockId={id}
|
||||
generalInformation={initialValue}
|
||||
kandangData={kandangData}
|
||||
@@ -77,17 +77,19 @@ const ClosingDetail: React.FC<ClosingDetailProps> = ({
|
||||
{
|
||||
id: 'hppEkspedisi',
|
||||
label: 'HPP Ekspedisi',
|
||||
content: <HppExpeditionReportTable initialValues={hppExpeditionData} />,
|
||||
content: (
|
||||
<HppExpeditionClosingTable initialValues={hppExpeditionData} />
|
||||
),
|
||||
},
|
||||
{
|
||||
id: 'dataProduksi',
|
||||
label: 'Data Produksi',
|
||||
content: <ClosingProductionDataTabContent projectFlockId={id} />,
|
||||
content: <ProductionDataClosingTab projectFlockId={id} />,
|
||||
},
|
||||
{
|
||||
id: 'keuangan',
|
||||
label: 'Keuangan',
|
||||
content: <ClosingFinanceTabContent projectFlockId={id} />,
|
||||
content: <FinanceClosingTab projectFlockId={id} />,
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
import ClosingFinanceTable from '@/components/pages/closing/table/ClosingFinanceTable';
|
||||
|
||||
const ClosingFinanceTabContent = ({
|
||||
projectFlockId,
|
||||
}: {
|
||||
projectFlockId: number;
|
||||
}) => {
|
||||
return (
|
||||
<div className='flex flex-col gap-4'>
|
||||
{projectFlockId && (
|
||||
<ClosingFinanceTable projectFlockId={projectFlockId} />
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default ClosingFinanceTabContent;
|
||||
@@ -1,36 +0,0 @@
|
||||
'use client';
|
||||
|
||||
import ClosingIncomingSapronaksTable from '@/components/pages/closing/table/ClosingIncomingSapronaksTable';
|
||||
import ClosingOutgoingSapronaksTable from '@/components/pages/closing/table/ClosingOutgoingSapronaksTable';
|
||||
import ClosingIncomingSapronaksSummaryTable from '@/components/pages/closing/table/ClosingIncomingSapronaksSummaryTable';
|
||||
import ClosingOutgoingSapronaksSummaryTable from '../table/ClosingOutgoingSapronaksSummaryTable';
|
||||
|
||||
interface ClosingSapronakTableProps {
|
||||
projectFlockId?: number;
|
||||
}
|
||||
|
||||
const ClosingSapronakTabContent = ({
|
||||
projectFlockId,
|
||||
}: ClosingSapronakTableProps) => {
|
||||
return (
|
||||
<div className='flex flex-col gap-4'>
|
||||
{projectFlockId && (
|
||||
<>
|
||||
<ClosingIncomingSapronaksTable projectFlockId={projectFlockId} />
|
||||
|
||||
<ClosingIncomingSapronaksSummaryTable
|
||||
projectFlockId={projectFlockId}
|
||||
/>
|
||||
|
||||
<ClosingOutgoingSapronaksTable projectFlockId={projectFlockId} />
|
||||
|
||||
<ClosingOutgoingSapronaksSummaryTable
|
||||
projectFlockId={projectFlockId}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default ClosingSapronakTabContent;
|
||||
@@ -0,0 +1,13 @@
|
||||
import FinanceClosingTable from '@/components/pages/closing/table/FinanceClosingTable';
|
||||
|
||||
const FinanceClosingTab = ({ projectFlockId }: { projectFlockId: number }) => {
|
||||
return (
|
||||
<div className='flex flex-col gap-4'>
|
||||
{projectFlockId && (
|
||||
<FinanceClosingTable projectFlockId={projectFlockId} />
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default FinanceClosingTab;
|
||||
+6
-6
@@ -1,22 +1,22 @@
|
||||
import ClosingOverheadTable from '@/components/pages/closing/table/ClosingOverheadTable';
|
||||
import OverheadClosingTable from '@/components/pages/closing/table/OverheadClosingTable';
|
||||
import { ClosingGeneralInformation } from '@/types/api/closing';
|
||||
import { ProjectFlockKandang } from '@/types/api/production/project-flock-kandang';
|
||||
|
||||
interface ClosingOverheadTabContentProps {
|
||||
interface OverheadClosingTabProps {
|
||||
projectFlockId: number;
|
||||
generalInformation?: ClosingGeneralInformation;
|
||||
kandangData?: ProjectFlockKandang;
|
||||
}
|
||||
|
||||
const ClosingOverheadTabContent = ({
|
||||
const OverheadClosingTab = ({
|
||||
projectFlockId,
|
||||
generalInformation,
|
||||
kandangData,
|
||||
}: ClosingOverheadTabContentProps) => {
|
||||
}: OverheadClosingTabProps) => {
|
||||
return (
|
||||
<div className='flex flex-col gap-4'>
|
||||
{projectFlockId && (
|
||||
<ClosingOverheadTable
|
||||
<OverheadClosingTable
|
||||
projectFlockId={projectFlockId}
|
||||
generalInformation={generalInformation}
|
||||
kandangData={kandangData}
|
||||
@@ -26,4 +26,4 @@ const ClosingOverheadTabContent = ({
|
||||
);
|
||||
};
|
||||
|
||||
export default ClosingOverheadTabContent;
|
||||
export default OverheadClosingTab;
|
||||
+4
-4
@@ -6,13 +6,13 @@ import { ClosingApi } from '@/services/api/closing';
|
||||
import { isResponseSuccess } from '@/lib/api-helper';
|
||||
import { formatNumber } from '@/lib/helper';
|
||||
|
||||
interface ClosingProductionDataTabContentProps {
|
||||
interface ProductionDataClosingTabProps {
|
||||
projectFlockId: number;
|
||||
}
|
||||
|
||||
const ClosingProductionDataTabContent = ({
|
||||
const ProductionDataClosingTab = ({
|
||||
projectFlockId,
|
||||
}: ClosingProductionDataTabContentProps) => {
|
||||
}: ProductionDataClosingTabProps) => {
|
||||
const searchParams = useSearchParams();
|
||||
const kandangId = searchParams.get('kandangId');
|
||||
|
||||
@@ -305,4 +305,4 @@ const ClosingProductionDataTabContent = ({
|
||||
);
|
||||
};
|
||||
|
||||
export default ClosingProductionDataTabContent;
|
||||
export default ProductionDataClosingTab;
|
||||
+6
-6
@@ -1,22 +1,22 @@
|
||||
'use client';
|
||||
|
||||
import ClosingSapronakCalculationTable from '@/components/pages/closing/table/ClosingSapronakCalculationTable';
|
||||
import SapronakCalculationClosingTable from '@/components/pages/closing/table/SapronakCalculationClosingTable';
|
||||
import { ClosingGeneralInformation } from '@/types/api/closing';
|
||||
|
||||
interface ClosingSapronakCalculationTabContentProps {
|
||||
interface SapronakCalculationClosingTabProps {
|
||||
projectFlockId?: number;
|
||||
closingGeneralInformation?: ClosingGeneralInformation;
|
||||
}
|
||||
|
||||
const ClosingSapronakCalculationTabContent = ({
|
||||
const SapronakCalculationClosingTab = ({
|
||||
projectFlockId,
|
||||
closingGeneralInformation,
|
||||
}: ClosingSapronakCalculationTabContentProps) => {
|
||||
}: SapronakCalculationClosingTabProps) => {
|
||||
return (
|
||||
<div className='flex flex-col gap-4'>
|
||||
{projectFlockId && (
|
||||
<>
|
||||
<ClosingSapronakCalculationTable
|
||||
<SapronakCalculationClosingTable
|
||||
closingGeneralInformation={closingGeneralInformation}
|
||||
projectFlockId={projectFlockId}
|
||||
/>
|
||||
@@ -26,4 +26,4 @@ const ClosingSapronakCalculationTabContent = ({
|
||||
);
|
||||
};
|
||||
|
||||
export default ClosingSapronakCalculationTabContent;
|
||||
export default SapronakCalculationClosingTab;
|
||||
@@ -0,0 +1,32 @@
|
||||
'use client';
|
||||
|
||||
import IncomingSapronaksTable from '@/components/pages/closing/table/IncomingSapronaksTable';
|
||||
import OutgoingSapronaksTable from '@/components/pages/closing/table/OutgoingSapronaksTable';
|
||||
import IncomingSapronaksSummaryTable from '@/components/pages/closing/table/IncomingSapronaksSummaryTable';
|
||||
import ClosingOutgoingSapronaksSummaryTable from '../table/OutgoingSapronaksSummaryTable';
|
||||
|
||||
interface SapronakClosingTabProps {
|
||||
projectFlockId?: number;
|
||||
}
|
||||
|
||||
const SapronakClosingTab = ({ projectFlockId }: SapronakClosingTabProps) => {
|
||||
return (
|
||||
<div className='flex flex-col gap-4'>
|
||||
{projectFlockId && (
|
||||
<>
|
||||
<IncomingSapronaksTable projectFlockId={projectFlockId} />
|
||||
|
||||
<IncomingSapronaksSummaryTable projectFlockId={projectFlockId} />
|
||||
|
||||
<OutgoingSapronaksTable projectFlockId={projectFlockId} />
|
||||
|
||||
<ClosingOutgoingSapronaksSummaryTable
|
||||
projectFlockId={projectFlockId}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default SapronakClosingTab;
|
||||
+2
-2
@@ -8,7 +8,7 @@ import { useSearchParams } from 'next/navigation';
|
||||
import { useMemo } from 'react';
|
||||
import useSWR from 'swr';
|
||||
|
||||
const ClosingFinanceTable = ({
|
||||
const FinanceClosingTable = ({
|
||||
projectFlockId,
|
||||
}: {
|
||||
projectFlockId: number;
|
||||
@@ -396,4 +396,4 @@ const ClosingFinanceTable = ({
|
||||
);
|
||||
};
|
||||
|
||||
export default ClosingFinanceTable;
|
||||
export default FinanceClosingTable;
|
||||
+4
-4
@@ -7,14 +7,14 @@ import Card from '@/components/Card';
|
||||
import { formatCurrency } from '@/lib/helper';
|
||||
import { BaseHppExpedition, BaseExpeditionCost } from '@/types/api/closing';
|
||||
|
||||
interface HppExpeditionReportTableProps {
|
||||
interface HppExpeditionClosingTableProps {
|
||||
type?: 'detail';
|
||||
initialValues?: BaseHppExpedition;
|
||||
}
|
||||
|
||||
const HppExpeditionReportTable = ({
|
||||
const HppExpeditionClosingTable = ({
|
||||
initialValues,
|
||||
}: HppExpeditionReportTableProps) => {
|
||||
}: HppExpeditionClosingTableProps) => {
|
||||
const costOfRevenueExpeditionData: BaseExpeditionCost[] = useMemo(() => {
|
||||
return initialValues?.expedition_costs || [];
|
||||
}, [initialValues]);
|
||||
@@ -106,4 +106,4 @@ const HppExpeditionReportTable = ({
|
||||
);
|
||||
};
|
||||
|
||||
export default HppExpeditionReportTable;
|
||||
export default HppExpeditionClosingTable;
|
||||
+4
-4
@@ -15,17 +15,17 @@ import { useSearchParams } from 'next/navigation';
|
||||
import { useMemo } from 'react';
|
||||
import useSWR from 'swr';
|
||||
|
||||
interface ClosingOverheadTableProps {
|
||||
interface OverheadClosingTableProps {
|
||||
projectFlockId: number;
|
||||
generalInformation?: ClosingGeneralInformation;
|
||||
kandangData?: ProjectFlockKandang;
|
||||
}
|
||||
|
||||
const ClosingOverheadTable = ({
|
||||
const OverheadClosingTable = ({
|
||||
projectFlockId,
|
||||
generalInformation,
|
||||
kandangData,
|
||||
}: ClosingOverheadTableProps) => {
|
||||
}: OverheadClosingTableProps) => {
|
||||
const searchParams = useSearchParams();
|
||||
const kandangId = searchParams.get('kandangId');
|
||||
|
||||
@@ -302,4 +302,4 @@ const ClosingOverheadTable = ({
|
||||
);
|
||||
};
|
||||
|
||||
export default ClosingOverheadTable;
|
||||
export default OverheadClosingTable;
|
||||
+3
-3
@@ -14,12 +14,12 @@ import { Product } from '@/types/api/master-data/product';
|
||||
import { Customer } from '@/types/api/master-data/customer';
|
||||
import { Kandang } from '@/types/api/master-data/kandang';
|
||||
|
||||
interface SalesReportTableProps {
|
||||
interface SalesClosingTableProps {
|
||||
type?: 'detail';
|
||||
initialValues?: BaseClosingSales;
|
||||
}
|
||||
|
||||
const SalesReportTable = ({ initialValues }: SalesReportTableProps) => {
|
||||
const SalesClosingTable = ({ initialValues }: SalesClosingTableProps) => {
|
||||
const salesData: BaseSales[] = useMemo(() => {
|
||||
return initialValues?.sales || [];
|
||||
}, [initialValues]);
|
||||
@@ -330,4 +330,4 @@ const SalesReportTable = ({ initialValues }: SalesReportTableProps) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default SalesReportTable;
|
||||
export default SalesClosingTable;
|
||||
+4
-4
@@ -16,15 +16,15 @@ import { isResponseSuccess } from '@/lib/api-helper';
|
||||
import { ClosingGeneralInformation } from '@/types/api/closing';
|
||||
import { useSearchParams } from 'next/navigation';
|
||||
|
||||
interface ClosingSapronakCalculationTableProps {
|
||||
interface SapronakCalculationClosingTableProps {
|
||||
projectFlockId: number;
|
||||
closingGeneralInformation?: ClosingGeneralInformation;
|
||||
}
|
||||
|
||||
const ClosingSapronakCalculationTable = ({
|
||||
const SapronakCalculationClosingTable = ({
|
||||
projectFlockId,
|
||||
closingGeneralInformation,
|
||||
}: ClosingSapronakCalculationTableProps) => {
|
||||
}: SapronakCalculationClosingTableProps) => {
|
||||
const searchParams = useSearchParams();
|
||||
const kandangId = searchParams.get('kandangId');
|
||||
|
||||
@@ -265,4 +265,4 @@ const ClosingSapronakCalculationTable = ({
|
||||
);
|
||||
};
|
||||
|
||||
export default ClosingSapronakCalculationTable;
|
||||
export default SapronakCalculationClosingTable;
|
||||
Reference in New Issue
Block a user