import React, { useState } from 'react'; import FormatAlignLeftIcon from '@material-ui/icons/FormatAlignLeft'; import ToggleButton from '@material-ui/lab/ToggleButton'; import ToggleButtonGroup from '@material-ui/lab/ToggleButtonGroup'; import { DARK_GRAY, MEDIUM_GRAY } from '../../constants/colors'; import { Typography } from '@material-ui/core'; export type OrientationToggleProps = { /** Which orientation is currently selected. */ orientation: 'vertical' | 'horizontal'; /** What action to take when orientation changes. */ onOrientationChange: (newOrientation: 'vertical' | 'horizontal') => void; /** Additional styles to apply to the widget container. */ containerStyles?: React.CSSProperties; }; /** * A simple UI widget for toggling plot orientation. */ export default function OrientationToggle({ orientation, onOrientationChange, containerStyles = {}, }: OrientationToggleProps) { const [focused, setFocused] = useState(false); return (