40 lines
No EOL
937 B
TypeScript
40 lines
No EOL
937 B
TypeScript
import React from "react";
|
|
import classNames from "classnames";
|
|
|
|
interface Props {
|
|
children: React.ReactNode;
|
|
className?: string;
|
|
disabled?: boolean;
|
|
onClick?: () => void;
|
|
size?: "small" | "medium" | "large";
|
|
type: 'submit' | 'button';
|
|
}
|
|
|
|
const SolidButton = ({ children, className, disabled = false, onClick, size, type }: Props) => {
|
|
const style = classNames(
|
|
"py-2 px-4 bg-primary text-white text-xl p-2 rounded hover:bg-secondary mb-0",
|
|
{
|
|
'text-xs': size === "small",
|
|
'font-size-18': !size || size === "medium",
|
|
},
|
|
className
|
|
)
|
|
|
|
if (onClick === undefined) {
|
|
onClick = () => {
|
|
}
|
|
}
|
|
|
|
return (
|
|
<button
|
|
className={ style }
|
|
disabled={ disabled }
|
|
onClick={ onClick }
|
|
type={ type }
|
|
>
|
|
{ children }
|
|
</button>
|
|
)
|
|
}
|
|
|
|
export default SolidButton |