import React, {
FunctionComponent,
AnchorHTMLAttributes,
ButtonHTMLAttributes,
LabelHTMLAttributes,
} from "react";
interface GetSharedStylesButton {
padding: string;
}
const getSharedStylesButton = (shared: GetSharedStylesButton): string => {
const { padding } = shared;
return `transition-colors duration-200 ease-out cursor-pointer font-gilroy-bold border ${padding}`;
};
export enum ButtonSize {
SM = "py-1 px-2 rounded-xl",
MD = "p-2 rounded-xl",
LG = "py-3 px-4 rounded-xl",
}
export interface ButtonTradeTrust
extends ButtonHTMLAttributes {
size?: ButtonSize;
}
interface AnchorTradeTrust extends AnchorHTMLAttributes {
size?: ButtonSize;
}
interface LabelTradeTrust extends LabelHTMLAttributes {
size?: ButtonSize;
}
export const Button: FunctionComponent = ({
className,
children,
disabled,
size = ButtonSize.MD,
...props
}) => {
const shared = getSharedStylesButton({ padding: size });
return (
);
};
export const ButtonIcon: FunctionComponent = ({
className,
children,
disabled,
size = ButtonSize.MD,
...props
}) => {
const shared = getSharedStylesButton({ padding: size });
return (
);
};
export const LinkButton: FunctionComponent = ({
className,
children,
size = ButtonSize.MD,
...props
}) => {
const shared = getSharedStylesButton({ padding: size });
return (
{children}
);
};
export const LabelButton: FunctionComponent = ({
className,
children,
size = ButtonSize.MD,
...props
}) => {
const shared = getSharedStylesButton({ padding: size });
return (
);
};