import { SegmentedControl } from '@automattic/components'; import clsx from 'clsx'; import { useTranslate } from 'i18n-calypso'; import { TabType } from 'calypso/performance-profiler/components/header'; import './style.scss'; type DeviceTabControlsProps = { onDeviceTabChange: ( tab: TabType ) => void; value: TabType; showTitle?: boolean; disabled?: boolean; }; export const DeviceTabControls = ( { onDeviceTabChange, value, showTitle, disabled, }: DeviceTabControlsProps ) => { const translate = useTranslate(); const options: { value: TabType; label: string }[] = [ { value: 'mobile', label: translate( 'Mobile' ), }, { value: 'desktop', label: translate( 'Desktop' ), }, ]; return (
{ showTitle && (
{ translate( 'Device' ) }
) } { options.map( ( option ) => { return ( onDeviceTabChange( option.value ) } > { option.label } ); } ) }
); };