import { Home } from 'lucide-react' import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled' import { METRICS, METRIC_CATEGORIES } from 'lib/constants/metrics' import { DropdownMenuCheckboxItem, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, } from 'ui' interface MetricOptionsProps { config: any handleChartSelection: any } export const MetricOptions = ({ config, handleChartSelection }: MetricOptionsProps) => { const { projectAuthAll: authEnabled, projectStorageAll: storageEnabled } = useIsFeatureEnabled([ 'project_auth:all', 'project_storage:all', ]) const metricCategories = Object.values(METRIC_CATEGORIES).filter(({ key }) => { if (key === 'api_auth') return authEnabled if (key === 'api_storage') return storageEnabled return true }) return metricCategories.map((cat) => { return ( {cat.icon ? cat.icon : }

{cat.label}

{METRICS.filter((metric) => metric?.category?.key === cat.key).map((metric) => { return ( x.attribute === metric.key)} onCheckedChange={(e) => handleChartSelection({ metric, value: e })} >
{metric.label}
) })}
) }) }