element-call/src/button/LinkButton.jsx

19 lines
466 B
React
Raw Normal View History

2021-12-13 16:16:25 -08:00
import React from "react";
import { Link } from "react-router-dom";
import classNames from "classnames";
2021-12-14 16:12:58 -08:00
import { variantToClassName, sizeToClassName } from "./Button";
2021-12-13 16:16:25 -08:00
2021-12-14 16:12:58 -08:00
export function LinkButton({ className, variant, size, children, ...rest }) {
2021-12-13 16:16:25 -08:00
return (
2021-12-14 16:12:58 -08:00
<Link
className={classNames(
variantToClassName[variant || "secondary"],
sizeToClassName[size],
className
)}
{...rest}
>
2021-12-13 16:16:25 -08:00
{children}
</Link>
);
}