mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-10-05 16:05:23 +00:00
Show no agreements if there is no agreement in agreement page 🔨
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 8m19s
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 8m19s
This commit is contained in:
@@ -3,23 +3,27 @@ import { AgreementCard } from "@/components/agreement-card";
|
|||||||
import { tryCatch } from "@/utils/tryCatch";
|
import { tryCatch } from "@/utils/tryCatch";
|
||||||
|
|
||||||
export default async function Agreements() {
|
export default async function Agreements() {
|
||||||
const [error, profile] = await tryCatch(getProfile())
|
const [error, profile] = await tryCatch(getProfile());
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div className="flex justify-between items-center border rounded-md border-dashed font-bold title-bg py-4 px-2 mb-4">
|
<div className="flex justify-between items-center border rounded-md border-dashed font-bold title-bg py-4 px-2 mb-4">
|
||||||
<h3 className="text-sarLinkOrange text-2xl">Agreements</h3>
|
<h3 className="text-sarLinkOrange text-2xl">Agreements</h3>
|
||||||
</div>
|
</div>
|
||||||
<div className="grid grid-cols-1">
|
<div className="grid grid-cols-1">
|
||||||
{error ? (
|
{error ? (
|
||||||
<div className="text-red-500">
|
<div className="text-red-500">
|
||||||
An error occurred while fetching agreements: {error.message}
|
An error occurred while fetching agreements: {error.message}
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div>
|
<div>
|
||||||
<AgreementCard agreement={profile.agreement ?? ""} />
|
{profile.agreement ? (
|
||||||
</div>
|
<AgreementCard agreement={profile.agreement} />
|
||||||
)}
|
) : (
|
||||||
</div>
|
<div className="text-gray-500">No agreement found.</div>
|
||||||
</div>
|
)}
|
||||||
);
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user