import type { FC, ReactNode } from "react"; import { Avatar, Paper, Stack, Text } from "@mantine/core"; import classes from "./EntryCard.module.css"; type EntryCardProps = { actions?: ReactNode; color?: string; details?: ReactNode; icon?: ReactNode; imageSrc?: null | string; initial: string; metadata: string; title: string; tone: "negative" | "neutral" | "positive"; value: string; valueLabel: string; wrap?: boolean; }; const EntryCard: FC = (props) => { const surfaceStyle = props.color ? { background: `color-mix(in srgb, var(--mantine-color-${props.color}-0) 45%, var(--wl-color-surface))`, } : undefined; const titleLineClamp = props.wrap ? undefined : 1; const valueContainerClass = props.actions ? classes.valueFooter : undefined; const valueLabelClass = `${classes[props.tone]} ${props.actions ? classes.valueLabel : ""}`; return ( {props.title} {props.metadata} {props.details} {props.value}
{props.valueLabel} {Boolean(props.actions) && (
{props.actions}
)}
); }; export { EntryCard };