@@ -15,18 +15,21 @@ interface PythLazerProps {
15
15
}
16
16
17
17
interface ModalContentProps {
18
- changes : Record < string , {
19
- prev ?: Partial < LazerState > ;
20
- new ?: Partial < LazerState > ;
21
- } > ,
22
- onSendProposal : ( ) => void ,
18
+ changes : Record <
19
+ string ,
20
+ {
21
+ prev ?: Partial < LazerState >
22
+ new ?: Partial < LazerState >
23
+ }
24
+ >
25
+ onSendProposal : ( ) => void
23
26
isSendProposalButtonLoading : boolean
24
27
}
25
28
26
29
const ModalContent : React . FC < ModalContentProps > = ( {
27
30
changes,
28
31
onSendProposal,
29
- isSendProposalButtonLoading
32
+ isSendProposalButtonLoading,
30
33
} ) => {
31
34
return (
32
35
< >
@@ -35,7 +38,10 @@ const ModalContent: React.FC<ModalContentProps> = ({
35
38
< tbody >
36
39
{ Object . entries ( changes ) . map ( ( [ key , change ] ) => (
37
40
< tr key = { key } >
38
- < td className = "base16 py-4 pl-6 pr-2 font-bold lg:pl-6" colSpan = { 2 } >
41
+ < td
42
+ className = "base16 py-4 pl-6 pr-2 font-bold lg:pl-6"
43
+ colSpan = { 2 }
44
+ >
39
45
{ key }
40
46
</ td >
41
47
< td className = "py-3 pl-6 pr-1 lg:pl-6" >
@@ -64,14 +70,18 @@ const ModalContent: React.FC<ModalContentProps> = ({
64
70
}
65
71
66
72
const PythLazer = ( {
67
- proposerServerUrl : _proposerServerUrl
73
+ proposerServerUrl : _proposerServerUrl ,
68
74
} : PythLazerProps ) => {
69
75
const { dataIsLoading, lazerState } = usePythContext ( )
70
76
const { cluster } = useContext ( ClusterContext )
71
77
72
- const [ dataChanges , setDataChanges ] = useState < Record < string , { prev ?: Partial < LazerState > ; new ?: Partial < LazerState > } > > ( )
78
+ const [ dataChanges , setDataChanges ] =
79
+ useState <
80
+ Record < string , { prev ?: Partial < LazerState > ; new ?: Partial < LazerState > } >
81
+ > ( )
73
82
const [ isModalOpen , setIsModalOpen ] = useState ( false )
74
- const [ isSendProposalButtonLoading , setIsSendProposalButtonLoading ] = useState ( false )
83
+ const [ isSendProposalButtonLoading , setIsSendProposalButtonLoading ] =
84
+ useState ( false )
75
85
76
86
const openModal = ( ) => {
77
87
setIsModalOpen ( true )
@@ -84,7 +94,9 @@ const PythLazer = ({
84
94
const handleDownloadJsonButtonClick = ( ) => {
85
95
if ( ! lazerState ) return
86
96
87
- const dataStr = 'data:text/json;charset=utf-8,' + encodeURIComponent ( JSON . stringify ( lazerState , null , 2 ) )
97
+ const dataStr =
98
+ 'data:text/json;charset=utf-8,' +
99
+ encodeURIComponent ( JSON . stringify ( lazerState , null , 2 ) )
88
100
const downloadAnchor = document . createElement ( 'a' )
89
101
downloadAnchor . setAttribute ( 'href' , dataStr )
90
102
downloadAnchor . setAttribute ( 'download' , `lazer_config_${ cluster } .json` )
@@ -142,7 +154,7 @@ const PythLazer = ({
142
154
setIsSendProposalButtonLoading ( true )
143
155
try {
144
156
// In a real implementation, this would send the proposal to the server
145
- await new Promise ( resolve => setTimeout ( resolve , 2000 ) ) // Mock delay
157
+ await new Promise ( ( resolve ) => setTimeout ( resolve , 2000 ) ) // Mock delay
146
158
147
159
// Close the modal and show success notification
148
160
setIsModalOpen ( false )
0 commit comments