refactor(FE-335): Rename expedition HPP types and update usages

This commit is contained in:
rstubryan
2025-12-18 16:26:09 +07:00
parent 447b8067f7
commit 8dc23f83cd
3 changed files with 14 additions and 26 deletions
@@ -5,24 +5,20 @@ import { ColumnDef } from '@tanstack/react-table';
import Table from '@/components/Table';
import Card from '@/components/Card';
import { formatCurrency } from '@/lib/helper';
import {
BaseClosingCostOfRevenueExpedition,
BaseCostOfRevenueExpedition,
} from '@/types/api/closing';
import { BaseHppExpedition, BaseExpeditionCost } from '@/types/api/closing';
interface CostOfRevenueExpeditionReportTableProps {
type?: 'detail';
initialValues?: BaseClosingCostOfRevenueExpedition;
initialValues?: BaseHppExpedition;
}
const CostOfRevenueExpeditionReportTable = ({
type = 'detail',
initialValues,
}: CostOfRevenueExpeditionReportTableProps) => {
const costOfRevenueExpeditionData: BaseCostOfRevenueExpedition[] =
useMemo(() => {
return initialValues?.expedition_costs || [];
}, [initialValues]);
const costOfRevenueExpeditionData: BaseExpeditionCost[] = useMemo(() => {
return initialValues?.expedition_costs || [];
}, [initialValues]);
const totals = useMemo(() => {
const totalHpp = initialValues?.total_hpp_amount || 0;
@@ -32,7 +28,7 @@ const CostOfRevenueExpeditionReportTable = ({
};
}, [initialValues]);
const costOfRevenueExpeditionColumns: ColumnDef<BaseCostOfRevenueExpedition>[] =
const costOfRevenueExpeditionColumns: ColumnDef<BaseExpeditionCost>[] =
useMemo(
() => [
{