LinkButton.tsx 940 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import { ButtonProps, Link, LinkProps } from "@mui/material";
  2. import React, { FC } from "react";
  3. export type LinkButtonProps = React.PropsWithChildren<{
  4. onClick: () => void;
  5. variant?: string;
  6. style?: React.CSSProperties;
  7. }>;
  8. const LinkButton: FC<LinkProps<"button", { color?: ButtonProps["color"] }>> = ({
  9. children,
  10. sx,
  11. color,
  12. ...props
  13. }) => {
  14. return (
  15. <Link
  16. component="button"
  17. sx={{
  18. color: "text.base",
  19. textDecoration: "underline rgba(255, 255, 255, 0.4)",
  20. paddingBottom: 0.5,
  21. "&:hover": {
  22. color: `${color}.main`,
  23. textDecoration: `underline `,
  24. textDecorationColor: `${color}.main`,
  25. },
  26. ...sx,
  27. }}
  28. {...props}
  29. >
  30. {children}
  31. </Link>
  32. );
  33. };
  34. export default LinkButton;