import { Fragment } from 'react'; import { Link } from 'react-router-dom'; import classes from './ActionButton.module.css'; import { Icon } from '../..'; interface Props { name: string; icon: string; link?: string; handler?: () => void; } export const ActionButton = (props: Props): JSX.Element => { const body = (
{props.name}
); if (props.link) { return ( {body} ); } else if (props.handler) { return (
{ if (e.key === 'Enter' && props.handler) props.handler(); }} tabIndex={0} > {body}
); } else { return
{body}
; } };