"use client"; import type { AriaRole, CSSProperties, PropsWithChildren, Ref } from "react"; import type { CardProps } from "@mantine/core"; import { Badge, Card } from "@mantine/core"; import combineClasses from "clsx"; import type { WidgetKind } from "@homarr/definitions"; import type { BoardItemAdvancedOptions } from "@homarr/validation/shared"; import classes from "./widget-card-shell.module.css"; const getOverflow = (kind: WidgetKind, hasCustomCssClasses: boolean): CSSProperties => { if (kind === "iframe" || kind === "assistant") return { overflowX: "hidden", overflowY: "hidden" }; if (hasCustomCssClasses) return {}; return { overflowX: "hidden", overflowY: "auto" }; }; interface WidgetCardShellProps extends PropsWithChildren> { kind: WidgetKind; advancedOptions: BoardItemAdvancedOptions; opacity: number; className?: string; innerRef?: Ref; id?: string; role?: AriaRole; "aria-label"?: string; "data-advanced-focus-surface"?: boolean; "data-grid-item-content"?: boolean; } export const WidgetCardShell = ({ kind, advancedOptions, opacity, className, innerRef, children, ...cardProps }: WidgetCardShellProps) => ( 0), } as CSSProperties, }} > {children} ); interface WidgetTitleBadgeProps { advancedOptions: BoardItemAdvancedOptions; opacity: number; radius: CardProps["radius"]; } export const WidgetTitleBadge = ({ advancedOptions, opacity, radius }: WidgetTitleBadgeProps) => { if (!advancedOptions.title?.trim()) return null; return ( {advancedOptions.title} ); };