fix(tenders): Hide empty submission URL and adjust section spacing

The "Submission Url" section on the tender details page was being rendered even when the URL was null or empty, leading to a visually broken component.

This commit wraps the "Submission Url" section in a conditional check to ensure it only renders when a URL is present.

Additionally, a `gap-2` utility has been added to the flex containers to improve the visual separation between detail sections.
This commit is contained in:
AmirReza Jamali
2025-09-18 16:55:53 +03:30
parent e1898bf259
commit 5aa6111460
+10 -7
View File
@@ -46,7 +46,7 @@ const TenderDetails = ({ params }: IProps) => {
{data?.data.status} {data?.data.status}
</Status> </Status>
</div> </div>
<div className="mt-4 flex justify-between border-b pb-4"> <div className="mt-4 flex justify-between gap-2 border-b pb-4">
<ShowcaseSection title="Tender ID"> <ShowcaseSection title="Tender ID">
{data?.data.tender_id} {data?.data.tender_id}
</ShowcaseSection> </ShowcaseSection>
@@ -63,15 +63,18 @@ const TenderDetails = ({ params }: IProps) => {
{data?.data.procurement_type_code} {data?.data.procurement_type_code}
</ShowcaseSection> </ShowcaseSection>
</div> </div>
<div className="mt-4 flex justify-between border-b pb-4"> <div className="mt-4 flex justify-between gap-2 border-b pb-4">
<ShowcaseSection title="Application Deadline"> <ShowcaseSection title="Application Deadline">
<span>{msToDate(data?.data.application_deadline ?? 0)}</span> <span>{msToDate(data?.data.application_deadline ?? 0)}</span>
</ShowcaseSection> </ShowcaseSection>
<ShowcaseSection title="Submission Url"> {data?.data.submission_url && (
<Link href={data?.data.submission_url ?? ""} target="_blank"> <ShowcaseSection title="Submission Url">
{data?.data.submission_url} <Link href={data?.data.submission_url ?? ""} target="_blank">
</Link> {data?.data.submission_url}
</ShowcaseSection> </Link>
</ShowcaseSection>
)}
<ShowcaseSection title="Publication Deadline"> <ShowcaseSection title="Publication Deadline">
<span>{msToDate(data?.data.publication_date ?? 0)}</span> <span>{msToDate(data?.data.publication_date ?? 0)}</span>
</ShowcaseSection> </ShowcaseSection>