import { Button, ButtonGroup } from "@mui/material"; import { useTheme } from '@mui/material/styles'; import { useTranslation } from "react-i18next"; export type FilterType = 'lastYear' | 'lastHalfYear' | 'lastMonth' | 'lastWeek' | ''; export interface FilterButtonsProps { currentFilter: FilterType; onFilterChange: (newFilter: FilterType) => void; } export const FilterButtons = ({ currentFilter, onFilterChange }: FilterButtonsProps) => { const [t] = useTranslation(); const theme = useTheme(); // Won't call onFilterChange if the filter stays the same const handleFilterChange = (newFilter: FilterType) => { if (currentFilter !== newFilter) { onFilterChange(newFilter); } }; return ( ); };