import { useRouter } from "next/router"; import { observer } from "mobx-react"; // hooks import { useApplication, useModule } from "hooks/store"; // ui import { Tooltip, ModuleStatusIcon } from "@plane/ui"; // helpers import { renderFormattedDate } from "helpers/date-time.helper"; // constants import { MODULE_STATUS } from "constants/module"; type Props = { moduleId: string; }; export const ModuleGanttBlock: React.FC = observer((props) => { const { moduleId } = props; // router const router = useRouter(); // store hooks const { router: { workspaceSlug }, } = useApplication(); const { getModuleById } = useModule(); // derived values const moduleDetails = getModuleById(moduleId); 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; // router const router = useRouter(); // store hooks const { router: { workspaceSlug }, } = useApplication(); const { getModuleById } = useModule(); // derived values const moduleDetails = getModuleById(moduleId); return (
router.push(`/${workspaceSlug}/projects/${moduleDetails?.project_id}/modules/${moduleDetails?.id}`) } >
{moduleDetails?.name}
); });