LinkButton.tsx 938 B

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