Files
web/packages/design-system/lib/components/TextLinkButton/TextLinkButton.tsx
Rasmus Langvad d0546926a9 Merged in fix/3697-prettier-configs (pull request #3396)
fix(SW-3691): Setup one prettier config for whole repo

* Setup prettierrc in root and remove other configs


Approved-by: Joakim Jäderberg
Approved-by: Linus Flood
2026-01-07 12:45:50 +00:00

41 lines
923 B
TypeScript

import { cx } from "class-variance-authority"
import { TextLinkProps } from "../TextLink/types"
import { getTextLinkClasses } from "./textLinkStyles"
import styles from "./textLinkButton.module.css"
export type TextLinkButtonProps = {
theme?: TextLinkProps["theme"]
typography?: TextLinkProps["typography"]
isDisabled?: TextLinkProps["isDisabled"]
isInline?: TextLinkProps["isInline"]
} & React.ButtonHTMLAttributes<HTMLButtonElement>
/* A Button with the same styling as a TextLink to handle an edge case. */
export function TextLinkButton({
theme,
isDisabled,
isInline,
typography,
className,
...props
}: TextLinkButtonProps) {
const classNames = getTextLinkClasses({
theme,
isDisabled,
isInline,
typography,
className,
})
return (
<button
{...props}
type="button"
disabled={isDisabled}
className={cx(classNames, styles.button)}
/>
)
}