st: 검토 메뉴 grid footer 수정 및 누락 부분 추가

This commit is contained in:
2026-02-05 14:47:47 +09:00
parent 56d47ca1d0
commit 4b0b08761c
7 changed files with 97 additions and 76 deletions
@@ -1,10 +1,15 @@
import type { SewerageSupplyRateItem } from "@/entities/statistics/model/statistics-input-interface";
export function toGridRows(items: SewerageSupplyRateItem[]): Record<string, string | number>[] {
/**
* 객체 배열을 그리드 row 형식으로 변환 (null/undefined → "").
* 어떤 엔티티 타입이든 공통 사용 가능.
*/
export function toGridRows<T extends object>(
items: T[]
): Record<string, string | number>[] {
return items.map((item) => {
const row: Record<string, string | number> = {};
for (const [key, value] of Object.entries(item)) {
row[key] = value === null || value === undefined ? "" : value;
row[key] =
value === null || value === undefined ? "" : (value as string | number);
}
return row;
});