feat: init
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled

This commit is contained in:
chuan
2025-11-11 01:56:44 +08:00
commit bba4bb40c8
4638 changed files with 447437 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
"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<TReadonlyDateProps> = observer((props) => {
const { className, hideIcon = false, value, placeholder, formatToken } = props;
const { t } = useTranslation();
const formattedDate = value ? renderFormattedDate(getDate(value), formatToken) : null;
return (
<div className={cn("flex items-center gap-1 text-sm", className)}>
{!hideIcon && <Calendar className="size-4 flex-shrink-0" />}
<span className="flex-grow truncate">{formattedDate ?? placeholder ?? t("common.none")}</span>
</div>
);
});