"use client"; import { observer } from "mobx-react"; import { Calendar } from "lucide-react"; // plane imports import { useTranslation } from "@plane/i18n"; import { cn, renderFormattedDate, getDate } from "@plane/utils"; export type TReadonlyDateProps = { className?: string; hideIcon?: boolean; value: Date | string | null; placeholder?: string; formatToken?: string; }; export const ReadonlyDate: React.FC = observer((props) => { const { className, hideIcon = false, value, placeholder, formatToken } = props; const { t } = useTranslation(); const formattedDate = value ? renderFormattedDate(getDate(value), formatToken) : null; return (
{!hideIcon && } {formattedDate ?? placeholder ?? t("common.none")}
); });