Files
astuto/app/javascript/components/common/Button.tsx

23 lines
517 B
TypeScript
Raw Normal View History

import * as React from 'react';
interface Props {
2019-09-20 18:43:24 +02:00
children: any;
onClick(e: React.FormEvent): void;
type?: 'button' | 'submit';
className?: string;
outline?: boolean;
2022-05-01 18:00:38 +02:00
disabled?: boolean;
}
const Button = ({ children, onClick, type="submit", className = '', outline = false, disabled = false}: Props) => (
<button
onClick={onClick}
type={type}
2024-01-23 18:50:42 +01:00
className={`${className} btn${outline ? 'Outline' : ''}Primary`}
2022-05-01 18:00:38 +02:00
disabled={disabled}
>
{children}
</button>
);
export default Button;