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:
@@ -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>
|
||||||
|
{data?.data.submission_url && (
|
||||||
<ShowcaseSection title="Submission Url">
|
<ShowcaseSection title="Submission Url">
|
||||||
<Link href={data?.data.submission_url ?? ""} target="_blank">
|
<Link href={data?.data.submission_url ?? ""} target="_blank">
|
||||||
{data?.data.submission_url}
|
{data?.data.submission_url}
|
||||||
</Link>
|
</Link>
|
||||||
</ShowcaseSection>
|
</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>
|
||||||
|
|||||||
Reference in New Issue
Block a user