import type { ComponentProps } from 'react'; import React from 'react'; import I18N from '../../i18n'; import { Dropdown, DropdownGroup, DropdownItem } from '../../ui/dropdown'; type MetricsTableOptionsProps = { onViewAllClick?: () => void; onResetClick?: () => void; onExportClick?: (sourceType: string) => void; } & ComponentProps; export const MetricsTableOptions = (props: MetricsTableOptionsProps) => { const { onViewAllClick, onResetClick, onExportClick, ...restProps } = props; return ( {(onResetClick || onViewAllClick) && ( {onResetClick && {I18N.RESET_FILTERS}} {onViewAllClick && {I18N.VIEW_ALL}} )} {onExportClick && ( onExportClick('csv')}>{I18N.EXPORT_CSV} onExportClick('json')}>{I18N.EXPORT_JSON} )} ); };