LinkButton.tsx 931 B

123456789101112131415161718192021222324252627282930313233343536
  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. {children}
  30. </Link>
  31. );
  32. };
  33. export default LinkButton;