import clsx from "clsx" import React from "react" import { useScroll } from "../../hooks/use-scroll" import Button from "../fundamentals/button" import Actionables, { ActionType } from "../molecules/actionables" type BodyCardProps = { title?: string | JSX.Element | React.ReactNode subtitle?: string events?: { label: string onClick: (e: React.MouseEvent) => void type?: React.ButtonHTMLAttributes["type"] }[] actionables?: ActionType[] forceDropdown?: boolean customActionable?: React.ReactNode status?: React.ReactNode customHeader?: React.ReactNode compact?: boolean footerMinHeight?: number setBorders?: boolean } & React.HTMLAttributes const BodyCard: React.FC = ({ title, subtitle, events, actionables, forceDropdown = false, customActionable, status, customHeader, className, children, compact = false, setBorders = false, footerMinHeight = 24, ...rest }) => { const { isScrolled, scrollListener } = useScroll({ threshold: 16 }) return (
{isScrolled && (
)}
{customHeader ? (
{customHeader}
) : title ? (

{title}

) : (
)} {subtitle && (

{subtitle}

)}
{status && status}
{children && (
{children}
)}
{events && events.length > 0 ? (
{events.map((event, i: React.Key) => { return ( ) })}
) : (
)}
) } export default BodyCard