add api utils

This commit is contained in:
Anika Raemer 2025-10-05 14:54:45 +02:00
parent ee3ac34e4b
commit bdd90b50d9
6 changed files with 99 additions and 93 deletions

View file

@ -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>
)
}