import React from "react"; import classnames from "classnames"; import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from "../utilities/props"; import { globalProps } from "../utilities/globalProps"; import DateTime from '../pb_kit/dateTime'; import Body from "../pb_body/_body"; import Caption from "../pb_caption/_caption"; import Flex from "../pb_flex/_flex"; import Icon from "../pb_icon/_icon"; import Title from "../pb_title/_title"; type LabelValueProps = { active?: boolean; aria?: { [key: string]: string }; className?: string; dark?: boolean; data?: object; date?: Date; htmlOptions?: {[key: string]: string | number | boolean | Function}; id?: string; label: string; value?: string; variant?: "default" | "details"; icon?: string; description?: string; title?: string; }; const dateString = (value: Date) => { const month = DateTime.toMonthNum(value); const day = DateTime.toDay(value); return ` ยท ${month}/${day}`; }; const LabelValue = (props: LabelValueProps) => { const { active = false, aria = {}, className, dark = false, data = {}, date, description, htmlOptions = {}, icon, id, label, title, value, variant = "default", } = props; const ariaProps = buildAriaProps(aria); const dataProps = buildDataProps(data) const htmlProps = buildHtmlProps(htmlOptions); const variantClass = variant === "details" ? "details" : ""; const classes = classnames( buildCss("pb_label_value_kit", variantClass), globalProps(props), className ); return (