link-stack/packages/leafcutter-ui/components/Button.tsx

43 lines
965 B
TypeScript
Raw Normal View History

2023-06-26 10:07:12 +00:00
"use client";
2023-02-13 13:46:56 +00:00
import { FC } from "react";
import Link from "next/link";
import { Button as MUIButton } from "@mui/material";
2024-03-20 17:51:21 +01:00
import { useLeafcutterContext } from "./LeafcutterProvider";
2023-02-13 13:46:56 +00:00
interface ButtonProps {
text: string;
color: string;
href: string;
}
export const Button: FC<ButtonProps> = ({ text, color, href }) => {
const {
colors: { white, almostBlack },
2024-03-20 17:51:21 +01:00
} = useLeafcutterContext();
2023-02-13 13:46:56 +00:00
return (
<Link href={href} passHref>
<MUIButton
variant="contained"
disableElevation
sx={{
fontFamily: "Poppins, sans-serif",
fontWeight: 700,
color:
color === white
? `${almostBlack} !important`
: `${white} !important`,
borderRadius: 999,
backgroundColor: color,
padding: "6px 30px",
margin: "20px 0px",
whiteSpace: "nowrap",
}}
>
{text}
</MUIButton>
</Link>
);
};