"use client"; import clsx from "clsx"; import { type ComponentProps, type ElementType, type ReactNode, use, } from "react"; import { OverlayTriggerStateContext } from "react-aria-components"; import styles from "./index.module.scss"; import { Button } from "../unstyled/Button/index.js"; import { Link } from "../unstyled/Link/index.js"; export const VARIANTS = ["primary", "secondary", "tertiary"] as const; type OwnProps = { variant?: (typeof VARIANTS)[number] | undefined; icon?: ReactNode | undefined; title?: ReactNode | undefined; toolbar?: ReactNode | ReactNode[] | undefined; footer?: ReactNode | undefined; nonInteractive?: boolean | undefined; }; export type Props = Omit< ComponentProps, keyof OwnProps > & OwnProps; export const Card = ( props: | (Props<"div"> & { nonInteractive?: true }) | Props | Props, ) => { const overlayState = use(OverlayTriggerStateContext); if (props.nonInteractive) { // eslint-disable-next-line @typescript-eslint/no-unused-vars const { nonInteractive, ...otherProps } = props; return
; } else if ("href" in props) { return ; } else if (overlayState !== null || "onPress" in props) { return