ente/packages/shared/components/LinkButton.tsx
Manav Rathi c1bf193211 Switch to prettier defaults
This is unfortunately a huge diff, but now is as good as ever to do this pending chore.

- Move to prettier (v3) defaults. The only thing we tweak is the tabWidth (the
  default is 2, we change it to 4).

- Use the prettier plugin to sort imports.

We were not changing the defaults of prettier much anyway, the main thing that
has changed is the switching from the overridden single quotes to the default
double quotes.
2024-02-24 14:03:53 +05:30

37 lines
940 B
TypeScript

import { ButtonProps, Link, LinkProps } from "@mui/material";
import React, { FC } from "react";
export type LinkButtonProps = React.PropsWithChildren<{
onClick: () => void;
variant?: string;
style?: React.CSSProperties;
}>;
const LinkButton: FC<LinkProps<"button", { color?: ButtonProps["color"] }>> = ({
children,
sx,
color,
...props
}) => {
return (
<Link
component="button"
sx={{
color: "text.base",
textDecoration: "underline rgba(255, 255, 255, 0.4)",
paddingBottom: 0.5,
"&:hover": {
color: `${color}.main`,
textDecoration: `underline `,
textDecorationColor: `${color}.main`,
},
...sx,
}}
{...props}
>
{children}
</Link>
);
};
export default LinkButton;