This commit is contained in:
2024-08-04 19:24:40 +05:00
parent 908ac73c6b
commit 1b22c31828
15 changed files with 373 additions and 9 deletions
+50
View File
@@ -0,0 +1,50 @@
interface Props {
variant?: "primary" | "secondary";
size?: "large" | "medium" | "small";
roundedFull?: boolean;
icon?: JSX.Element;
onlyIcon?: boolean;
children?: React.ReactNode;
onClick?: () => void;
}
const variantClasses = {
primary: "bg-[#00BED7] text-white hover:bg-[#0AB3C9]",
secondary: "",
};
const sizeClasses = {
large: "px-4 py-3 gap-2 text-base",
medium: "px-3.5 py-2.5 gap-1 text-sm",
small: "px-3 py-2.5 gap-1 text-xs",
};
function Button2({
variant = "primary",
size = "medium",
roundedFull = false,
icon,
onlyIcon = false,
children,
onClick,
}: Props) {
return (
<button
className={`flex items-center transition-colors w-fit ${
variantClasses[variant]
} ${sizeClasses[size]} ${roundedFull ? "rounded-full" : "rounded-lg"} `}
onClick={onClick}
>
{onlyIcon ? (
icon
) : (
<>
{icon}
{children}
</>
)}
</button>
);
}
export default Button2;