add api utils
This commit is contained in:
parent
ee3ac34e4b
commit
bdd90b50d9
6 changed files with 99 additions and 93 deletions
|
|
@ -0,0 +1,29 @@
|
|||
import { Link, type LinkProps } from "react-router-dom"
|
||||
import { ButtonType } from "./Button"
|
||||
|
||||
type ButtonLinkProps = LinkProps & {
|
||||
text: string
|
||||
buttonType?: ButtonType
|
||||
className?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Link component having the same stile as the button
|
||||
*/
|
||||
export default function ButtonLink({
|
||||
to,
|
||||
text,
|
||||
buttonType = ButtonType.DefaultButton,
|
||||
className = "",
|
||||
...props
|
||||
}: ButtonLinkProps) {
|
||||
return (
|
||||
<Link
|
||||
to={to}
|
||||
className={`basic-button ${buttonType.backgroundColor} ${buttonType.textColor} ${className}`}
|
||||
{...props}
|
||||
>
|
||||
{text}
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue