import { Text, clx } from "@medusajs/ui" import { useTranslation } from "react-i18next" import { useDate } from "../../../hooks/use-date" type DateRangeDisplayProps = { startsAt?: Date | string | null endsAt?: Date | string | null showTime?: boolean } export const DateRangeDisplay = ({ startsAt, endsAt, showTime = false, }: DateRangeDisplayProps) => { const startDate = startsAt ? new Date(startsAt) : null const endDate = endsAt ? new Date(endsAt) : null const { t } = useTranslation() const { getFullDate } = useDate() return (
{t("fields.startDate")} {startDate ? getFullDate({ date: startDate, includeTime: showTime, }) : "-"}
{t("fields.endDate")} {endDate ? getFullDate({ date: endDate, includeTime: showTime, }) : "-"}
) } const Bar = ({ date }: { date: Date | null }) => { const now = new Date() const isDateInFuture = date && date > now return (
) }