import React, { useMemo } from 'react'; import { useSupplyDemandAnalysis } from '@/hooks/api/useAnalyticsAPI.ts'; import { useTranslation } from '@/hooks/useI18n.tsx'; import type { ItemCount } from '@/services/analytics-api.ts'; const SupplyChainAnalysis = () => { const { t } = useTranslation(); const { data: supplyDemand } = useSupplyDemandAnalysis(); // Helper function to render resource list const ResourceList = React.memo( ({ title, data, barColor }: { title: string; data: ItemCount[]; barColor: string }) => { // Memoize maxValue calculation const maxValue = useMemo(() => (data.length > 0 ? data[0].count : 0), [data]); return (
{t('heritage.noData')}
)}