refactor(FE): Remove unused imports and redundant code

This commit is contained in:
rstubryan
2026-02-20 14:17:26 +07:00
parent de0f9ae985
commit 1f2f3acebb
90 changed files with 222 additions and 474 deletions
@@ -1,6 +1,6 @@
import * as XLSX from 'xlsx';
import { ReportExpense } from '@/types/api/report/report-expense';
import { formatCurrency, formatDate } from '@/lib/helper';
import { formatDate } from '@/lib/helper';
export const generateReportExpenseExcel = async (
data: ReportExpense[]
@@ -65,7 +65,7 @@ const getTableColumns = (
header: 'No',
flex: 0.5,
align: 'center',
cell: ({ row, index }) => index + 1,
cell: ({ index }) => index + 1,
footer: 'Total',
},
{
@@ -49,7 +49,7 @@ const getTableColumns = (total?: DebtSupplier['total']): PdfColumn[] => {
header: 'No',
flex: 0.5,
align: 'center',
cell: ({ row, index }) => index + 1,
cell: ({ index }) => index + 1,
footer: 'Total',
},
{
@@ -2,7 +2,7 @@
import ExcelJS from 'exceljs';
import { formatDate } from '@/lib/helper';
import { DebtRow, DebtSupplier } from '@/types/api/report/debt-supplier';
import { DebtSupplier } from '@/types/api/report/debt-supplier';
interface DebtSupplierExportExcelParams {
data: DebtSupplier[];
@@ -1,7 +1,6 @@
import DataStateSkeleton from '@/components/helper/skeleton/DataStateSkeleton';
import Table from '@/components/Table';
import { DebtRow } from '@/types/api/report/debt-supplier';
import { Icon } from '@iconify/react';
import { ColumnDef } from '@tanstack/react-table';
const DebtSupplierSkeleton = ({
@@ -129,7 +129,7 @@ const DebtSupplierTab = ({ tabId }: DebtSupplierTabProps) => {
filterModal.closeModal();
setIsSubmitted(true);
},
onReset: (values) => {
onReset: () => {
setFilterParams({
start_date: undefined,
end_date: undefined,
@@ -170,10 +170,6 @@ const DebtSupplierTab = ({ tabId }: DebtSupplierTabProps) => {
: [],
[debtSupplier]
);
const meta =
isResponseSuccess(debtSupplier) && debtSupplier?.meta
? debtSupplier.meta
: null;
// ===== EXPORT DATA FETCHER =====
const debtSupplierExport = useCallback(async (): Promise<
@@ -61,7 +61,7 @@ const getTableColumns = (
header: 'No',
flex: 0.5,
align: 'center',
cell: ({ row, index }) => index + 1,
cell: ({ index }) => index + 1,
footer: 'Total',
},
{
@@ -336,11 +336,6 @@ const PurchasesPerSupplierTab = ({ tabId }: PurchasesPerSupplierTabProps) => {
[purchasePerSupplier]
);
const meta =
isResponseSuccess(purchasePerSupplier) && purchasePerSupplier?.meta
? purchasePerSupplier.meta
: null;
// ===== EXPORT DATA FETCHER =====
const logisticPurchasePerSupplierExport = useCallback(async (): Promise<
LogisticPurchasePerSupplierReport[] | null
@@ -52,7 +52,7 @@ const getTableColumns = (
header: 'No',
flex: 0.5,
align: 'center',
cell: ({ row, index }) => index + 1,
cell: ({ index }) => index + 1,
},
{
key: 'so_date',
@@ -142,7 +142,7 @@ const getDetailColumns = (
header: 'No',
flex: 0.5,
align: 'center',
cell: ({ row, index }) => index + 1,
cell: ({ index }) => index + 1,
footer: 'TOTAL',
},
{
@@ -324,11 +324,6 @@ const HppPerKandangTab = ({ tabId }: HppPerKandangTabProps) => {
[hppPerKandang]
);
const period =
isResponseSuccess(hppPerKandang) && hppPerKandang?.data?.period
? hppPerKandang.data.period
: undefined;
// ===== EXPORT DATA FETCHER =====
const hppPerKandangExport =
useCallback(async (): Promise<HppPerKandangReport | null> => {
@@ -28,7 +28,6 @@ const ProductionResultProjectFlockKandangTable = ({
setPage,
setPageSize,
toQueryString: getTableFilterQueryString,
reset: resetFilter,
} = useTableFilter({
initial: {
filter_by: '',