/profile dont look like i can edit them anymore
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 6s
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 6s
This commit is contained in:
@@ -3,7 +3,6 @@ import { getServerSession } from "next-auth";
|
|||||||
import { authOptions } from "@/app/auth";
|
import { authOptions } from "@/app/auth";
|
||||||
import ClientErrorMessage from "@/components/client-error-message";
|
import ClientErrorMessage from "@/components/client-error-message";
|
||||||
import { Badge } from "@/components/ui/badge";
|
import { Badge } from "@/components/ui/badge";
|
||||||
import { FloatingLabelInput } from "@/components/ui/floating-label";
|
|
||||||
import { getProfileById } from "@/queries/users";
|
import { getProfileById } from "@/queries/users";
|
||||||
import { tryCatch } from "@/utils/tryCatch";
|
import { tryCatch } from "@/utils/tryCatch";
|
||||||
|
|
||||||
@@ -24,58 +23,34 @@ export default async function Profile() {
|
|||||||
{verifiedStatus(profile?.verified ?? false)}
|
{verifiedStatus(profile?.verified ?? false)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<fieldset>
|
<div className="rounded-md border bg-muted/30 p-4">
|
||||||
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 max-w-4xl">
|
<dl className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-x-6 gap-y-4 max-w-4xl">
|
||||||
<FloatingLabelInput
|
<ReadOnlyField
|
||||||
id="floating-name"
|
|
||||||
label="Full Name"
|
label="Full Name"
|
||||||
value={`${profile?.first_name} ${profile?.last_name}`}
|
value={`${profile?.first_name} ${profile?.last_name}`}
|
||||||
readOnly
|
|
||||||
/>
|
/>
|
||||||
<FloatingLabelInput
|
<ReadOnlyField label="ID Card" value={profile?.id_card} />
|
||||||
id="floating-id-card"
|
<ReadOnlyField
|
||||||
label="ID Card"
|
|
||||||
value={`${profile?.id_card}`}
|
|
||||||
readOnly
|
|
||||||
/>
|
|
||||||
<FloatingLabelInput
|
|
||||||
id="floating-island"
|
|
||||||
label="Island"
|
label="Island"
|
||||||
value={`${profile?.atoll?.name}. ${profile?.island?.name}`}
|
value={`${profile?.atoll?.name}. ${profile?.island?.name}`}
|
||||||
readOnly
|
|
||||||
/>
|
/>
|
||||||
<FloatingLabelInput
|
<ReadOnlyField
|
||||||
id="floating-dob"
|
|
||||||
label="Date of Birth"
|
label="Date of Birth"
|
||||||
value={`${new Date(
|
value={
|
||||||
profile?.dob?.toString() ?? "",
|
profile?.dob
|
||||||
).toLocaleDateString("en-US", {
|
? new Date(profile.dob.toString()).toLocaleDateString("en-US", {
|
||||||
month: "short",
|
month: "short",
|
||||||
day: "2-digit",
|
day: "2-digit",
|
||||||
year: "numeric",
|
year: "numeric",
|
||||||
})}`}
|
})
|
||||||
readOnly
|
: undefined
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
<FloatingLabelInput
|
<ReadOnlyField label="Address" value={profile?.address} />
|
||||||
id="floating-address"
|
<ReadOnlyField label="Phone Number" value={profile?.mobile} />
|
||||||
label="Address"
|
<ReadOnlyField label="Account Number" value={profile?.acc_no} />
|
||||||
value={`${profile?.address}`}
|
</dl>
|
||||||
readOnly
|
</div>
|
||||||
/>
|
|
||||||
<FloatingLabelInput
|
|
||||||
id="floating-mobile"
|
|
||||||
label="Phone Number"
|
|
||||||
value={`${profile?.mobile}`}
|
|
||||||
readOnly
|
|
||||||
/>
|
|
||||||
<FloatingLabelInput
|
|
||||||
id="floating-account"
|
|
||||||
label="Account Number"
|
|
||||||
value={`${profile?.acc_no}`}
|
|
||||||
readOnly
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
|
||||||
{/* <Suspense key={query} fallback={"loading...."}>
|
{/* <Suspense key={query} fallback={"loading...."}>
|
||||||
<TopupsTable searchParams={searchParams} />
|
<TopupsTable searchParams={searchParams} />
|
||||||
</Suspense> */}
|
</Suspense> */}
|
||||||
@@ -83,6 +58,25 @@ export default async function Profile() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function ReadOnlyField({
|
||||||
|
label,
|
||||||
|
value,
|
||||||
|
}: {
|
||||||
|
label: string;
|
||||||
|
value?: string | null;
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<div className="flex flex-col gap-1">
|
||||||
|
<dt className="text-xs font-medium uppercase tracking-wide text-muted-foreground">
|
||||||
|
{label}
|
||||||
|
</dt>
|
||||||
|
<dd className="text-sm font-medium text-foreground break-words">
|
||||||
|
{value?.trim() ? value : "—"}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
function verifiedStatus(status: boolean) {
|
function verifiedStatus(status: boolean) {
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case true:
|
case true:
|
||||||
|
|||||||
Reference in New Issue
Block a user