1
1
import { PageTitle } from "@/components/PageTitle"
2
2
import { Skeleton } from "@/components/ui/skeleton"
3
- import { identityDetail } from "@/generated/client/sdk.gen"
3
+ import { identityDetail , mintInfo } from "@/generated/client/sdk.gen"
4
4
import { useSuspenseQuery } from "@tanstack/react-query"
5
5
import { Suspense } from "react"
6
6
@@ -23,6 +23,16 @@ function PageBody() {
23
23
gcTime : Infinity ,
24
24
} )
25
25
26
+ const { data : mintData } = useSuspenseQuery ( {
27
+ queryKey : [ "mint-info" ] ,
28
+ queryFn : async ( ) => {
29
+ const response = await mintInfo ( )
30
+ return response . data ?? null
31
+ } ,
32
+ staleTime : Infinity ,
33
+ gcTime : Infinity ,
34
+ } )
35
+
26
36
if ( ! data ) {
27
37
return (
28
38
< div className = "bg-card text-card-foreground rounded-lg border p-6" >
@@ -33,8 +43,62 @@ function PageBody() {
33
43
34
44
return (
35
45
< div className = "flex flex-col gap-4" >
46
+ { mintData && (
47
+ < div className = "bg-card text-card-foreground rounded-lg border p-6" >
48
+ < h3 className = "text-lg font-semibold mb-4" > Mint Information</ h3 >
49
+ < div className = "grid grid-cols-1 md:grid-cols-2 gap-4" >
50
+ { mintData . name && (
51
+ < div className = "flex flex-col gap-1" >
52
+ < span className = "text-xs text-muted-foreground uppercase tracking-wide font-medium" > Name</ span >
53
+ < span className = "font-semibold text-base" > { mintData . name } </ span >
54
+ </ div >
55
+ ) }
56
+ { mintData . version && (
57
+ < div className = "flex flex-col gap-1" >
58
+ < span className = "text-xs text-muted-foreground uppercase tracking-wide font-medium" > Version</ span >
59
+ < span className = "text-sm" > { mintData . version } </ span >
60
+ </ div >
61
+ ) }
62
+ { mintData . description && (
63
+ < div className = "flex flex-col gap-1 md:col-span-2" >
64
+ < span className = "text-xs text-muted-foreground uppercase tracking-wide font-medium" > Description</ span >
65
+ < span className = "text-sm" > { mintData . description } </ span >
66
+ </ div >
67
+ ) }
68
+ { mintData . description_long && (
69
+ < div className = "flex flex-col gap-1 md:col-span-2" >
70
+ < span className = "text-xs text-muted-foreground uppercase tracking-wide font-medium" >
71
+ Long Description
72
+ </ span >
73
+ < span className = "text-sm" > { mintData . description_long } </ span >
74
+ </ div >
75
+ ) }
76
+ { mintData . pubkey && (
77
+ < div className = "flex flex-col gap-1 md:col-span-2" >
78
+ < span className = "text-xs text-muted-foreground uppercase tracking-wide font-medium" > Public Key</ span >
79
+ < span className = "font-mono text-sm break-all bg-muted p-2 rounded text-muted-foreground" >
80
+ { mintData . pubkey }
81
+ </ span >
82
+ </ div >
83
+ ) }
84
+ { mintData . contact && mintData . contact . length > 0 && (
85
+ < div className = "flex flex-col gap-1 md:col-span-2" >
86
+ < span className = "text-xs text-muted-foreground uppercase tracking-wide font-medium" > Contact</ span >
87
+ < div className = "flex flex-wrap gap-2" >
88
+ { mintData . contact . map ( ( contact , index ) => (
89
+ < span key = { index } className = "text-sm bg-muted px-2 py-1 rounded" >
90
+ { contact }
91
+ </ span >
92
+ ) ) }
93
+ </ div >
94
+ </ div >
95
+ ) }
96
+ </ div >
97
+ </ div >
98
+ ) }
99
+
36
100
< div className = "bg-card text-card-foreground rounded-lg border p-6" >
37
- < h3 className = "text-lg font-semibold mb-4" > Information </ h3 >
101
+ < h3 className = "text-lg font-semibold mb-4" > Identity </ h3 >
38
102
< div className = "grid grid-cols-1 md:grid-cols-2 gap-4" >
39
103
< div className = "flex flex-col gap-1" >
40
104
< span className = "text-xs text-muted-foreground uppercase tracking-wide font-medium" > Name</ span >
0 commit comments