This repository has been archived on 2026-11-04. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
mus/src/app/components/Button.tsx
T
2024-12-22 22:49:22 +01:00

28 lines
792 B
TypeScript

interface ButtonProps {
text: string;
type: "primary" | "secondary";
icon?: React.ReactNode;
link: string;
}
const Button: React.FC<ButtonProps> = ({ text, type, icon, link }) => {
const buttonClass = type === "secondary"
? "flex flex-row flex-1 rounded-lgs p-3 gap-3 place-content-between items-center justify-center border border-white text-white bg-transparent"
: "flex flex-row flex-1 rounded-lgs p-3 gap-3 place-content-between items-center justify-center bg-white text-black";
const textClass = type === "secondary" ? "text-white text-lg" : "text-black text-lg";
return (
<a
href={link}
className={buttonClass}
rel="noopener noreferrer"
>
{icon}
<p className={textClass}>{text}</p>
</a>
);
};
export default Button;