import type { ForwardedRef, ReactNode } from "react"; import { forwardRef } from "react"; import type { ActionIconProps } from "@mantine/core"; import { ActionIcon } from "@mantine/core"; import { Link } from "@homarr/ui"; type HeaderButtonProps = ( | { onClick?: () => void; } | { href: string; } ) & { children: ReactNode; onFocus?: () => void; onPointerDown?: () => void; onPointerEnter?: () => void; } & Partial; const headerButtonActionIconProps: ActionIconProps = { variant: "subtle", style: { border: "none" }, color: "gray", size: "lg", }; export const HeaderButton = forwardRef((props, ref) => { if ("href" in props) { return ( } component={Link} {...props} {...headerButtonActionIconProps} > {props.children} ); } return ( {props.children} ); });