mirror of
https://github.com/astuto/astuto.git
synced 2025-12-15 11:17:49 +01:00
26 lines
515 B
TypeScript
26 lines
515 B
TypeScript
import * as React from 'react';
|
|
|
|
interface Props {
|
|
onClick: React.MouseEventHandler<HTMLAnchorElement>;
|
|
icon?: React.ReactElement;
|
|
disabled?: boolean;
|
|
customClass?: string;
|
|
children: React.ReactNode;
|
|
}
|
|
|
|
const ActionLink = ({
|
|
onClick,
|
|
icon,
|
|
disabled = false,
|
|
customClass,
|
|
children,
|
|
}: Props) => (
|
|
<a
|
|
onClick={onClick}
|
|
className={`actionLink${disabled ? ' actionLinkDisabled' : ''}${customClass ? ' ' + customClass : ''}`}
|
|
>
|
|
{icon}{children}
|
|
</a>
|
|
);
|
|
|
|
export default ActionLink; |