mirror of
https://github.com/zkldi/Tachi.git
synced 2026-09-28 01:48:11 +03:00
30 lines
542 B
TypeScript
30 lines
542 B
TypeScript
import React, { CSSProperties } from "react";
|
|
import { Link } from "react-router-dom";
|
|
import { JustChildren } from "types/react";
|
|
|
|
export default function LinkButton({
|
|
to,
|
|
className = "btn-primary",
|
|
children,
|
|
style,
|
|
onClick,
|
|
disabled = false,
|
|
}: {
|
|
to: string;
|
|
className?: string;
|
|
style?: CSSProperties;
|
|
onClick?: () => void;
|
|
disabled?: boolean;
|
|
} & JustChildren) {
|
|
return (
|
|
<Link
|
|
onClick={onClick}
|
|
to={to}
|
|
className={`btn ${disabled ? "disabled" : ""} ${className}`}
|
|
style={style}
|
|
>
|
|
{children}
|
|
</Link>
|
|
);
|
|
}
|