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}
|
||||
</Status>
|
||||
</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">
|
||||
{data?.data.tender_id}
|
||||
</ShowcaseSection>
|
||||
@@ -63,15 +63,18 @@ const TenderDetails = ({ params }: IProps) => {
|
||||
{data?.data.procurement_type_code}
|
||||
</ShowcaseSection>
|
||||
</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">
|
||||
<span>{msToDate(data?.data.application_deadline ?? 0)}</span>
|
||||
</ShowcaseSection>
|
||||
<ShowcaseSection title="Submission Url">
|
||||
<Link href={data?.data.submission_url ?? ""} target="_blank">
|
||||
{data?.data.submission_url}
|
||||
</Link>
|
||||
</ShowcaseSection>
|
||||
{data?.data.submission_url && (
|
||||
<ShowcaseSection title="Submission Url">
|
||||
<Link href={data?.data.submission_url ?? ""} target="_blank">
|
||||
{data?.data.submission_url}
|
||||
</Link>
|
||||
</ShowcaseSection>
|
||||
)}
|
||||
|
||||
<ShowcaseSection title="Publication Deadline">
|
||||
<span>{msToDate(data?.data.publication_date ?? 0)}</span>
|
||||
</ShowcaseSection>
|
||||
|
||||
Reference in New Issue
Block a user