34 lines
921 B
TypeScript
34 lines
921 B
TypeScript
'use client'
|
|
|
|
import {useLayoutFilter} from "@/components/layout/LayoutFilterContext";
|
|
import BannerSummary from "@/components/lge-dashboard/combo/BannerSummary";
|
|
import {useMemo} from "react";
|
|
import {ServerBannerRow} from "@/types/lg";
|
|
import {apiOwnershipSummary, apiPurchaseRateKpis} from "@/config/sample.data";
|
|
|
|
const Profile = () => {
|
|
const { isTotal, filterValue } = useLayoutFilter();
|
|
|
|
const profileData = useMemo<ServerBannerRow[]>(() => {
|
|
if (isTotal) return [];
|
|
|
|
const typeLabel = filterValue.type.label;
|
|
|
|
switch (typeLabel) {
|
|
case "보유":
|
|
return apiOwnershipSummary;
|
|
case "구매":
|
|
return apiPurchaseRateKpis;
|
|
case "향후 구매":
|
|
return apiPurchaseRateKpis;
|
|
default:
|
|
return [];
|
|
}
|
|
}, [isTotal, filterValue]);
|
|
|
|
return (
|
|
<BannerSummary data={profileData} useChart={false} useYear={true} />
|
|
);
|
|
}
|
|
|
|
export default Profile; |