59 lines
1.3 KiB
TypeScript
59 lines
1.3 KiB
TypeScript
"use client";
|
|
|
|
import React from "react";
|
|
import { cn } from "@/lib/utils";
|
|
import {GaugeColumn, GaugeTable} from "@/components/lge-dashboard";
|
|
import Card from "@/components/lge-dashboard/card/Card";
|
|
|
|
export type GaugeCardTableProps<T> = {
|
|
/** 카드 제목 */
|
|
title: string;
|
|
/** GaugeTable columns */
|
|
columns: GaugeColumn<T>[];
|
|
/** GaugeTable rows */
|
|
rows: T[];
|
|
|
|
/** GaugeTable 옵션들 (필요한 것만 노출) */
|
|
cellHeight?: number;
|
|
fillColor?: string;
|
|
trackColor?: string;
|
|
|
|
className?: string;
|
|
cardClassName?: string;
|
|
tableClassName?: string;
|
|
};
|
|
|
|
const GaugeCardTable = <T extends Record<string, unknown>>(
|
|
props: GaugeCardTableProps<T>
|
|
) => {
|
|
const {
|
|
title,
|
|
columns,
|
|
rows,
|
|
cellHeight = 26,
|
|
fillColor,
|
|
trackColor,
|
|
className,
|
|
cardClassName,
|
|
tableClassName,
|
|
} = props;
|
|
|
|
return (
|
|
<div className={cn("w-full", className)}>
|
|
<Card label={title} className={cardClassName}>
|
|
<div className={cn("w-full", tableClassName)}>
|
|
<GaugeTable
|
|
columns={columns}
|
|
rows={rows}
|
|
cellHeight={cellHeight}
|
|
fillColor={fillColor}
|
|
trackColor={trackColor}
|
|
/>
|
|
</div>
|
|
</Card>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default GaugeCardTable;
|