import { observer } from "mobx-react"; import Link from "next/link"; import { useRouter } from "next/router"; // hooks // ui import { Tooltip, ModuleStatusIcon } from "@plane/ui"; // helpers import { MODULE_STATUS } from "@/constants/module"; import { renderFormattedDate } from "@/helpers/date-time.helper"; // constants import { useAppRouter, useModule } from "@/hooks/store"; import { usePlatformOS } from "@/hooks/use-platform-os"; type Props = { moduleId: string; }; export const ModuleGanttBlock: React.FC = observer((props) => { const { moduleId } = props; // router const router = useRouter(); // store hooks const { workspaceSlug } = useAppRouter(); const { getModuleById } = useModule(); // derived values const moduleDetails = getModuleById(moduleId); // hooks const { isMobile } = usePlatformOS(); return (
s.value === moduleDetails?.status)?.color }} onClick={() => router.push(`/${workspaceSlug}/projects/${moduleDetails?.project_id}/modules/${moduleDetails?.id}`) } >
{moduleDetails?.name}
{renderFormattedDate(moduleDetails?.start_date ?? "")} to{" "} {renderFormattedDate(moduleDetails?.target_date ?? "")}
} position="top-left" >
{moduleDetails?.name}
); }); export const ModuleGanttSidebarBlock: React.FC = observer((props) => { const { moduleId } = props; // store hooks const { workspaceSlug } = useAppRouter(); const { getModuleById } = useModule(); // derived values const moduleDetails = getModuleById(moduleId); return (
{moduleDetails?.name}
); });