-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3d38338
commit 3c60df5
Showing
12 changed files
with
494 additions
and
432 deletions.
There are no files selected for viewing
156 changes: 102 additions & 54 deletions
156
packages/nextjs/app/dashboard/attestation/[uid]/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,90 +1,138 @@ | ||
'use client' | ||
"use client"; | ||
import React, { useState, useEffect } from "react"; | ||
import { useRouter,useSearchParams } from "next/navigation"; | ||
import { fetchAttestation,Attestation } from "~~/utils/utils"; | ||
import { useRouter, useSearchParams } from "next/navigation"; | ||
import { fetchAttestation, Attestation } from "~~/utils/utils"; | ||
|
||
export default function AttestationPage({ | ||
params, | ||
}: { | ||
params: { uid: string }; | ||
}) { | ||
const uid = params.uid; | ||
const [attestation, setAttestation] = useState<Attestation | null>(null); | ||
|
||
useEffect(() => { | ||
console.log("UUID:", uid); | ||
if (uid) { | ||
fetchAttestation(uid) | ||
.then((data) => { | ||
console.log("Fetched data:", data); | ||
setAttestation(data); | ||
}) | ||
.catch((error) => { | ||
console.error("Error fetching attestation:", error); | ||
}); | ||
} | ||
}, [uid]); | ||
|
||
export default function AttestationPage({ params }: { params: { uid: string } }) { | ||
const uid = params.uid; | ||
const [attestation, setAttestation] = useState<Attestation | null>(null); | ||
|
||
useEffect(() => { | ||
console.log('UUID:', uid); | ||
if (uid) { | ||
fetchAttestation(uid) | ||
.then(data => { | ||
console.log('Fetched data:', data); | ||
setAttestation(data); | ||
}) | ||
.catch(error => { | ||
console.error('Error fetching attestation:', error); | ||
}); | ||
} | ||
}, [uid]); | ||
|
||
if (!attestation) { | ||
return <div>Loading...</div>; | ||
} | ||
|
||
return ( | ||
<div className="attestation-container p-6 shadow-md rounded-lg bg-[#E9E9F6]"> | ||
if (!attestation) { | ||
return <div>Loading...</div>; | ||
} | ||
|
||
return ( | ||
<div className="attestation-container p-6 shadow-md rounded-lg bg-[#E9E9F6]"> | ||
<div className="mb-4"> | ||
<span className="block text-sm text-gray-600">UID:</span> | ||
<span className="block text-lg font-semibold text-gray-600">{attestation.uid}</span> | ||
<span className="block text-lg font-semibold text-gray-600"> | ||
{attestation.uid} | ||
</span> | ||
</div> | ||
<div className="border rounded-md overflow-hidden"> | ||
<table className="min-w-full bg-white"> | ||
<tbody> | ||
<tr className="border-b"> | ||
<td className="px-4 py-2 text-sm font-medium text-gray-700 bg-gray-50">Schema</td> | ||
<td className="px-4 py-2 text-sm text-gray-900">{attestation.schema}</td> | ||
<td className="px-4 py-2 text-sm font-medium text-gray-700 bg-gray-50"> | ||
Schema | ||
</td> | ||
<td className="px-4 py-2 text-sm text-gray-900"> | ||
{attestation.schema} | ||
</td> | ||
</tr> | ||
<tr className="border-b"> | ||
<td className="px-4 py-2 text-sm font-medium text-gray-700 bg-gray-50">Is Endorsement</td> | ||
<td className="px-4 py-2 text-sm text-gray-900">{attestation.isEndorsement ? 'True' : 'False'}</td> | ||
<td className="px-4 py-2 text-sm font-medium text-gray-700 bg-gray-50"> | ||
Is Endorsement | ||
</td> | ||
<td className="px-4 py-2 text-sm text-gray-900"> | ||
{attestation.isEndorsement ? "True" : "False"} | ||
</td> | ||
</tr> | ||
<tr className="border-b"> | ||
<td className="px-4 py-2 text-sm font-medium text-gray-700 bg-gray-50">Name</td> | ||
<td className="px-4 py-2 text-sm text-gray-900">{attestation.name}</td> | ||
<td className="px-4 py-2 text-sm font-medium text-gray-700 bg-gray-50"> | ||
Name | ||
</td> | ||
<td className="px-4 py-2 text-sm text-gray-900"> | ||
{attestation.name} | ||
</td> | ||
</tr> | ||
<tr className="border-b"> | ||
<td className="px-4 py-2 text-sm font-medium text-gray-700 bg-gray-50">Domain</td> | ||
<td className="px-4 py-2 text-sm text-gray-900">{attestation.domain}</td> | ||
<td className="px-4 py-2 text-sm font-medium text-gray-700 bg-gray-50"> | ||
Domain | ||
</td> | ||
<td className="px-4 py-2 text-sm text-gray-900"> | ||
{attestation.domain} | ||
</td> | ||
</tr> | ||
<tr className="border-b"> | ||
<td className="px-4 py-2 text-sm font-medium text-gray-700 bg-gray-50">Context</td> | ||
<td className="px-4 py-2 text-sm text-gray-900">{attestation.context}</td> | ||
<td className="px-4 py-2 text-sm font-medium text-gray-700 bg-gray-50"> | ||
Context | ||
</td> | ||
<td className="px-4 py-2 text-sm text-gray-900"> | ||
{attestation.context} | ||
</td> | ||
</tr> | ||
<tr className="border-b"> | ||
<td className="px-4 py-2 text-sm font-medium text-gray-700 bg-gray-50">IPFS Hash</td> | ||
<td className="px-4 py-2 text-sm text-gray-900"><a href={attestation.ipfsHash} className="text-blue-500">{attestation.ipfsHash}</a></td> | ||
<td className="px-4 py-2 text-sm font-medium text-gray-700 bg-gray-50"> | ||
IPFS Hash | ||
</td> | ||
<td className="px-4 py-2 text-sm text-gray-900"> | ||
<a href={attestation.ipfsHash} className="text-blue-500"> | ||
{attestation.ipfsHash} | ||
</a> | ||
</td> | ||
</tr> | ||
<tr className="border-b"> | ||
<td className="px-4 py-2 text-sm font-medium text-gray-700 bg-gray-50">From</td> | ||
<td className="px-4 py-2 text-sm text-gray-900">{attestation.from}</td> | ||
<td className="px-4 py-2 text-sm font-medium text-gray-700 bg-gray-50"> | ||
From | ||
</td> | ||
<td className="px-4 py-2 text-sm text-gray-900"> | ||
{attestation.from} | ||
</td> | ||
</tr> | ||
<tr className="border-b"> | ||
<td className="px-4 py-2 text-sm font-medium text-gray-700 bg-gray-50">To</td> | ||
<td className="px-4 py-2 text-sm text-gray-900">{attestation.to}</td> | ||
<td className="px-4 py-2 text-sm font-medium text-gray-700 bg-gray-50"> | ||
To | ||
</td> | ||
<td className="px-4 py-2 text-sm text-gray-900"> | ||
{attestation.to} | ||
</td> | ||
</tr> | ||
<tr className="border-b"> | ||
<td className="px-4 py-2 text-sm font-medium text-gray-700 bg-gray-50">Created</td> | ||
<td className="px-4 py-2 text-sm text-gray-900">{attestation.created}</td> | ||
<td className="px-4 py-2 text-sm font-medium text-gray-700 bg-gray-50"> | ||
Created | ||
</td> | ||
<td className="px-4 py-2 text-sm text-gray-900"> | ||
{attestation.created} | ||
</td> | ||
</tr> | ||
<tr className="border-b"> | ||
<td className="px-4 py-2 text-sm font-medium text-gray-700 bg-gray-50">Expiration</td> | ||
<td className="px-4 py-2 text-sm text-gray-900">{attestation.expiration}</td> | ||
<td className="px-4 py-2 text-sm font-medium text-gray-700 bg-gray-50"> | ||
Expiration | ||
</td> | ||
<td className="px-4 py-2 text-sm text-gray-900"> | ||
{attestation.expiration} | ||
</td> | ||
</tr> | ||
<tr> | ||
<td className="px-4 py-2 text-sm font-medium text-gray-700 bg-gray-50">Revoked</td> | ||
<td className="px-4 py-2 text-sm text-gray-900">{attestation.revoked}</td> | ||
<td className="px-4 py-2 text-sm font-medium text-gray-700 bg-gray-50"> | ||
Revoked | ||
</td> | ||
<td className="px-4 py-2 text-sm text-gray-900"> | ||
{attestation.revoked} | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
|
||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,73 @@ | ||
'use client' | ||
"use client"; | ||
import React, { useState, useEffect } from "react"; | ||
import { useRouter,useSearchParams } from "next/navigation"; | ||
import { fetchSchema,Schema } from "~~/utils/utils"; | ||
import { useRouter, useSearchParams } from "next/navigation"; | ||
import { fetchSchema, Schema } from "~~/utils/utils"; | ||
|
||
export default function AttestationPage({ | ||
params, | ||
}: { | ||
params: { uid: string }; | ||
}) { | ||
const uid = params.uid; | ||
const [schema, setSchema] = useState<Schema | null>(null); | ||
|
||
useEffect(() => { | ||
console.log("UUID:", uid); | ||
if (uid) { | ||
fetchSchema(uid) | ||
.then((data) => { | ||
console.log("Fetched data:", data); | ||
setSchema(data); | ||
}) | ||
.catch((error) => { | ||
console.error("Error fetching schema:", error); | ||
}); | ||
} | ||
}, [uid]); | ||
|
||
export default function AttestationPage({ params }: { params: { uid: string } }) { | ||
const uid = params.uid; | ||
const [schema, setSchema] = useState<Schema | null>(null); | ||
|
||
useEffect(() => { | ||
console.log('UUID:', uid); | ||
if (uid) { | ||
fetchSchema(uid) | ||
.then(data => { | ||
console.log('Fetched data:', data); | ||
setSchema(data); | ||
}) | ||
.catch(error => { | ||
console.error('Error fetching schema:', error); | ||
}); | ||
} | ||
}, [uid]); | ||
|
||
if (!schema) { | ||
return <div>Loading...</div>; | ||
} | ||
|
||
return ( | ||
<div className="attestation-container p-6 shadow-md rounded-lg bg-[#E9E9F6]"> | ||
if (!schema) { | ||
return <div>Loading...</div>; | ||
} | ||
|
||
return ( | ||
<div className="attestation-container p-6 shadow-md rounded-lg bg-[#E9E9F6]"> | ||
<div className="mb-4"> | ||
<span className="block text-sm text-gray-600">UID:</span> | ||
<span className="block text-lg font-semibold text-gray-600">{schema.uid}</span> | ||
<span className="block text-lg font-semibold text-gray-600"> | ||
{schema.uid} | ||
</span> | ||
</div> | ||
<div className="border rounded-md overflow-hidden"> | ||
<table className="min-w-full bg-white"> | ||
<tbody> | ||
<tr className="border-b"> | ||
<td className="px-4 py-2 text-sm font-medium text-gray-700 bg-gray-50">UID</td> | ||
<td className="px-4 py-2 text-sm text-gray-900">{schema.uid ? 'True' : 'False'}</td> | ||
<tr className="border-b"> | ||
<td className="px-4 py-2 text-sm font-medium text-gray-700 bg-gray-50"> | ||
UID | ||
</td> | ||
<td className="px-4 py-2 text-sm text-gray-900"> | ||
{schema.uid ? "True" : "False"} | ||
</td> | ||
</tr> | ||
|
||
<tr className="border-b"> | ||
<td className="px-4 py-2 text-sm font-medium text-gray-700 bg-gray-50">Schema</td> | ||
<td className="px-4 py-2 text-sm text-gray-900">{schema.schema}</td> | ||
<td className="px-4 py-2 text-sm font-medium text-gray-700 bg-gray-50"> | ||
Schema | ||
</td> | ||
<td className="px-4 py-2 text-sm text-gray-900"> | ||
{schema.schema} | ||
</td> | ||
</tr> | ||
<tr className="border-b"> | ||
<td className="px-4 py-2 text-sm font-medium text-gray-700 bg-gray-50">Attestations</td> | ||
<td className="px-4 py-2 text-sm text-gray-900">{schema.attestations ? 'True' : 'False'}</td> | ||
<td className="px-4 py-2 text-sm font-medium text-gray-700 bg-gray-50"> | ||
Attestations | ||
</td> | ||
<td className="px-4 py-2 text-sm text-gray-900"> | ||
{schema.attestations ? "True" : "False"} | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
|
||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.