dishplanner/frontend/app/components/ui/Buttons/SolidButton.tsx

40 lines
No EOL
954 B
TypeScript

import React, { type FC } 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: FC<Props> = ({ children, className, disabled = false, onClick, size, type }) => {
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