import Link from "next/link"; import Image from "next/image"; import { useRouter } from "next/router"; // icons import User from "public/user.png"; // types import { IModule } from "types"; // common import { renderShortNumericDateFormat } from "constants/common"; import { CalendarDaysIcon } from "@heroicons/react/24/outline"; import { MODULE_STATUS } from "constants/"; type Props = { module: IModule; }; const SingleModuleCard: React.FC = ({ module }) => { const router = useRouter(); const { workspaceSlug } = router.query; return ( {module.name}
LEAD
{module.lead_detail?.avatar && module.lead_detail.avatar !== "" ? (
{module.lead_detail.first_name}
) : (
{module.lead_detail?.first_name && module.lead_detail.first_name !== "" ? module.lead_detail.first_name.charAt(0) : module.lead_detail?.email.charAt(0)}
)}
MEMBERS
{module.members && module.members.length > 0 ? ( module?.members_detail?.map((member, index: number) => (
{member?.avatar && member.avatar !== "" ? (
{member?.first_name}
) : (
{member?.first_name && member.first_name !== "" ? member.first_name.charAt(0) : member?.email?.charAt(0)}
)}
)) ) : (
No user
)}
END DATE
{renderShortNumericDateFormat(module.target_date ?? "")}
STATUS
s.value === module.status)?.color, }} > {module.status}
); }; export default SingleModuleCard;