3
3
import React , { useState , useEffect } from 'react'
4
4
import { HeadState , HeadMember } from '@/app/model'
5
5
import MemberCommitDetails from '../MemberCommitDetails'
6
+ import { useCardanoExplorer } from '@/providers/CardanoExplorer'
6
7
7
8
interface HeadDetailsProps {
8
9
head : HeadState
@@ -36,6 +37,8 @@ const HeadDetails: React.FC<HeadDetailsProps> = ({ head, onClose }) => {
36
37
}
37
38
} , [ onClose , showMemberCommitDetails ] )
38
39
40
+ const explorer = useCardanoExplorer ( )
41
+
39
42
return (
40
43
< div className = "fixed inset-0 flex items-center justify-center bg-gray-900 bg-opacity-50 z-50" >
41
44
< div className = "bg-gray-800 p-6 rounded-lg shadow-xl relative overflow-auto max-h-screen" >
@@ -50,17 +53,23 @@ const HeadDetails: React.FC<HeadDetailsProps> = ({ head, onClose }) => {
50
53
< div className = "border p-4" >
51
54
< h3 className = "text-lg font-semibold mb-2" > Head ID</ h3 >
52
55
< p >
53
- < a href = { `https://sancho.cexplorer.io/policy/ ${ head . headId } /mint` } target = "_blank" className = "text-blue-300 hover:text-blue-500" >
56
+ < a href = { explorer . mintPolicy ( head . headId ) } target = "_blank" className = "text-blue-300 hover:text-blue-500" >
54
57
{ head . headId }
55
58
</ a >
56
59
</ p >
57
60
</ div >
58
61
< div className = "border p-4" >
59
62
< h3 className = "text-lg font-semibold mb-2" > Seed Tx In</ h3 >
60
63
< p >
61
- < a href = { `https://sancho.cexplorer.io/tx/${ head . seedTxIn } ` } target = "_blank" className = "text-blue-300 hover:text-blue-500" >
62
- { head . seedTxIn }
63
- </ a >
64
+ { head . seedTxIn && (
65
+ < a
66
+ href = { explorer . tx ( head . seedTxIn ) }
67
+ target = "_blank"
68
+ className = "text-blue-300 hover:text-blue-500"
69
+ >
70
+ { head . seedTxIn }
71
+ </ a >
72
+ ) }
64
73
</ p >
65
74
</ div >
66
75
< div className = "border p-4" >
@@ -86,7 +95,7 @@ const HeadDetails: React.FC<HeadDetailsProps> = ({ head, onClose }) => {
86
95
< div className = "border p-4" >
87
96
< h3 className = "text-lg font-semibold mb-2" > Point</ h3 >
88
97
< p >
89
- Block Hash: < a href = { `https://sancho.cexplorer.io/ block/ ${ head . point . blockHash } ` } target = "_blank" className = "text-blue-300 hover:text-blue-500" >
98
+ Block Hash: < a href = { explorer . block ( head . point . blockHash ) } target = "_blank" className = "text-blue-300 hover:text-blue-500" >
90
99
{ head . point . blockHash }
91
100
</ a > < br />
92
101
Slot: { head . point . slot }
0 commit comments