mirror of
https://github.com/astuto/astuto.git
synced 2025-12-16 19:57:52 +01:00
Add ReactIcons (#149)
This commit is contained in:
committed by
GitHub
parent
4c73b398e8
commit
6198d814d8
26
app/javascript/components/common/ActionLink.tsx
Normal file
26
app/javascript/components/common/ActionLink.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user