import { IconLabel, List, ListItem } from '@umami/react-zen'; import { Empty } from '@/components/common/Empty'; import { LoadingPanel } from '@/components/common/LoadingPanel'; import { useWebsiteSegmentsQuery } from '@/components/hooks'; import { ChartPie, UserPlus } from '@/components/icons'; export interface SegmentFiltersProps { websiteId: string; segmentId: string; type?: string; onChange?: (id: string, type: string) => void; } export function SegmentFilters({ websiteId, segmentId, type = 'segment', onChange, }: SegmentFiltersProps) { const { data, isLoading, isFetching } = useWebsiteSegmentsQuery(websiteId, { type }); const handleChange = (id: string) => { onChange?.(id, type); }; return ( {data?.data?.length === 0 && } handleChange(id[0])}> {data?.data?.map(item => { return ( : }> {item.name} ); })} ); }