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

37 lines
No EOL
896 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 OutlineButton: FC<Props> = ({ children, className, disabled = false, onClick, size, type }) => {
const style = classNames(
"justify-center border-2 border-accent font-size-18 text-accent-blue py-2 px-4 rounded flex",
{ 'text-xs': size === "small" },
className
)
if (onClick === undefined) {
onClick = () => {
}
}
return (
<button
type={ type }
className={ style }
disabled={ disabled }
onClick={ onClick }
>
{ children }
</button>
)
}
export default OutlineButton