Archived
28 lines
792 B
TypeScript
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;
|