This commit is contained in:
Manav Rathi 2025-01-17 12:07:48 +05:30
parent 0a359b0835
commit bfe62d2209
No known key found for this signature in database

View File

@ -1,6 +1,5 @@
import { Link } from "@mui/material"; import { Link, type ButtonProps } from "@mui/material";
import React from "react"; import React from "react";
import { type ButtonishProps } from "./mui";
/** /**
* A button that looks like a link. * A button that looks like a link.
@ -8,10 +7,9 @@ import { type ButtonishProps } from "./mui";
* The use of this component is not encouraged. It is only useful in uncommon * The use of this component is not encouraged. It is only useful in uncommon
* cases where we do not have sufficient space to include a proper button. * cases where we do not have sufficient space to include a proper button.
*/ */
export const LinkButton: React.FC<React.PropsWithChildren<ButtonishProps>> = ({ export const LinkButton: React.FC<
onClick, React.PropsWithChildren<Pick<ButtonProps, "onClick">>
children, > = ({ onClick, children }) => (
}) => (
<Link <Link
component="button" component="button"
sx={(theme) => ({ sx={(theme) => ({
@ -39,7 +37,7 @@ export const LinkButton: React.FC<React.PropsWithChildren<ButtonishProps>> = ({
* Similar caveats as {@link LinkButton} apply. * Similar caveats as {@link LinkButton} apply.
*/ */
export const LinkButtonUndecorated: React.FC< export const LinkButtonUndecorated: React.FC<
React.PropsWithChildren<ButtonishProps> React.PropsWithChildren<Pick<ButtonProps, "onClick">>
> = ({ onClick, children }) => ( > = ({ onClick, children }) => (
<Link <Link
component="button" component="button"