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

This commit is contained in:
2025-09-20 11:16:06 +05:00
parent b32b61afe8
commit 950ac676f0

View File

@@ -3,7 +3,7 @@ import { AgreementCard } from "@/components/agreement-card";
import { tryCatch } from "@/utils/tryCatch";
export default async function Agreements() {
const [error, profile] = await tryCatch(getProfile())
const [error, profile] = await tryCatch(getProfile());
return (
<div>
<div className="flex justify-between items-center border rounded-md border-dashed font-bold title-bg py-4 px-2 mb-4">
@@ -16,7 +16,11 @@ export default async function Agreements() {
</div>
) : (
<div>
<AgreementCard agreement={profile.agreement ?? ""} />
{profile.agreement ? (
<AgreementCard agreement={profile.agreement} />
) : (
<div className="text-gray-500">No agreement found.</div>
)}
</div>
)}
</div>