Files
wkc-website/src/components/buttons/Custom.tsx
2024-03-11 18:04:10 -04:00

26 lines
656 B
TypeScript

import React from "react";
import { Box, Link, Button, BoxProps, Text } from "@chakra-ui/react";
import { motion } from "framer-motion";
interface CustomButtonProps {
text: string;
link: string;
type: "primary" | "secondary" | "footer";
}
const MotionBox = motion<BoxProps>(Box);
const CustomButton = ({ text, link, type }: CustomButtonProps): JSX.Element => {
return (
<MotionBox whileHover={{ scale: 1.1 }} whileTap={{ scale: 0.9 }}>
<Link href={link} target="_blank" rel="noopener">
<Button variant={type}>
<Text>{text}</Text>
</Button>
</Link>
</MotionBox>
);
};
export default CustomButton;