import Link, { LinkProps } from '@material-ui/core/Link' import { makeStyles, Theme, useTheme } from '@material-ui/core/styles' import React from 'react' import { useNavigate } from 'react-router-dom' export interface OptionFieldProps extends Pick, 'href'> { optionLabel: string optionSelected: boolean } export function OptionField(props: OptionFieldProps) { const { optionLabel, optionSelected, href } = props const navigateToRoute = useNavigate() const theme = useTheme() const styles = useOptionFieldStyles(props) return (
{ navigateToRoute(href) }} >
{optionLabel}
) } const useOptionFieldStyles = makeStyles((theme) => ({ fieldContainer: { marginBottom: theme.spacing(0.25), display: 'flex', flexDirection: 'row', }, optionInputContainer: { display: 'flex', alignItems: 'center', justifyContent: 'center', paddingRight: theme.spacing(1), }, optionInput: { width: theme.spacing(2), height: theme.spacing(2), }, optionLabel: { fontWeight: 600, }, }))