// ui import { CustomDatePicker } from "components/ui"; // helpers import { findHowManyDaysLeft, renderShortNumericDateFormat } from "helpers/date-time.helper"; // types import { IIssue } from "types"; type Props = { issue: IIssue; partialUpdateIssue: (formData: Partial) => void; isNotAllowed: boolean; }; export const DueDateSelect: React.FC = ({ issue, partialUpdateIssue, isNotAllowed }) => (
partialUpdateIssue({ target_date: val, }) } className={issue?.target_date ? "w-[6.5rem]" : "w-[3rem] text-center"} />
Due date
{renderShortNumericDateFormat(issue.target_date ?? "")}
{issue.target_date ? issue.target_date < new Date().toISOString() ? `Due date has passed by ${findHowManyDaysLeft(issue.target_date)} days` : findHowManyDaysLeft(issue.target_date) <= 3 ? `Due date is in ${findHowManyDaysLeft(issue.target_date)} days` : "Due date" : "N/A"}
);