import { Link } from "@remix-run/react"; import type { LinkProps } from "@remix-run/react"; import clsx from "clsx"; import * as React from "react"; export interface ButtonProps extends React.ButtonHTMLAttributes { variant?: | "primary" | "success" | "outlined" | "outlined-success" | "destructive" | "minimal" | "minimal-success" | "minimal-destructive"; size?: "miniscule" | "tiny" | "big"; loading?: boolean; loadingText?: string; icon?: JSX.Element; testId?: string; _ref?: React.LegacyRef | React.ForwardedRef; } export function Button(props: ButtonProps) { const { variant, loading, children, loadingText, size, className, icon, type = "button", testId, _ref, ...rest } = props; return ( ); } type LinkButtonProps = Pick< ButtonProps, "variant" | "children" | "className" | "size" | "testId" | "icon" > & Pick & { "data-cy"?: string; isExternal?: boolean; onClick?: () => void; }; export function LinkButton({ variant, children, size, className, to, prefetch, isExternal, testId, icon, preventScrollReset, onClick, }: LinkButtonProps) { if (isExternal) { return ( {icon && React.cloneElement(icon, { className: clsx("button-icon", { lonely: !children, }), })} {children} ); } return ( {icon && React.cloneElement(icon, { className: clsx("button-icon", { lonely: !children }), })} {children} ); }