mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-08-04 09:37:42 +00:00
feat(agreements): implement agreement fetching and display with error handling
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 13m34s
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 13m34s
feat(agreement-card): create AgreementCard component for displaying user agreements fix(devices-table): update no devices message for clarity based on parental control fix(payments-table): update no payments message for consistency fix(topups-table): update no topups message for consistency feat(user): add agreement field to User interface
This commit is contained in:
@ -1,11 +1,25 @@
|
||||
import React from "react";
|
||||
import { getProfile } from "@/actions/user-actions";
|
||||
import { AgreementCard } from "@/components/agreement-card";
|
||||
import { tryCatch } from "@/utils/tryCatch";
|
||||
|
||||
export default function Agreements() {
|
||||
export default async function Agreements() {
|
||||
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">
|
||||
<h3 className="text-sarLinkOrange text-2xl">Agreements</h3>
|
||||
</div>
|
||||
<div className="grid grid-cols-1">
|
||||
{error ? (
|
||||
<div className="text-red-500">
|
||||
An error occurred while fetching agreements: {error.message}
|
||||
</div>
|
||||
) : (
|
||||
<div>
|
||||
<AgreementCard agreement={profile.agreement ?? ""} />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user