import { Fragment } from 'react'; import { Link } from 'react-router-dom'; import classes from './ActionButton.module.css'; import Icon from '../../Icons/Icon/Icon'; interface ComponentProps { name: string; icon: string; link?: string; handler?: () => void; } const ActionButton = (props: ComponentProps): 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}
) } } export default ActionButton;