@@ -15,18 +15,21 @@ interface PythLazerProps {
1515}
1616
1717interface 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
2326 isSendProposalButtonLoading : boolean
2427}
2528
2629const ModalContent : React . FC < ModalContentProps > = ( {
2730 changes,
2831 onSendProposal,
29- isSendProposalButtonLoading
32+ isSendProposalButtonLoading,
3033} ) => {
3134 return (
3235 < >
@@ -35,7 +38,10 @@ const ModalContent: React.FC<ModalContentProps> = ({
3538 < tbody >
3639 { Object . entries ( changes ) . map ( ( [ key , change ] ) => (
3740 < 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+ >
3945 { key }
4046 </ td >
4147 < td className = "py-3 pl-6 pr-1 lg:pl-6" >
@@ -64,14 +70,18 @@ const ModalContent: React.FC<ModalContentProps> = ({
6470}
6571
6672const PythLazer = ( {
67- proposerServerUrl : _proposerServerUrl
73+ proposerServerUrl : _proposerServerUrl ,
6874} : PythLazerProps ) => {
6975 const { dataIsLoading, lazerState } = usePythContext ( )
7076 const { cluster } = useContext ( ClusterContext )
7177
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+ > ( )
7382 const [ isModalOpen , setIsModalOpen ] = useState ( false )
74- const [ isSendProposalButtonLoading , setIsSendProposalButtonLoading ] = useState ( false )
83+ const [ isSendProposalButtonLoading , setIsSendProposalButtonLoading ] =
84+ useState ( false )
7585
7686 const openModal = ( ) => {
7787 setIsModalOpen ( true )
@@ -84,7 +94,9 @@ const PythLazer = ({
8494 const handleDownloadJsonButtonClick = ( ) => {
8595 if ( ! lazerState ) return
8696
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 ) )
88100 const downloadAnchor = document . createElement ( 'a' )
89101 downloadAnchor . setAttribute ( 'href' , dataStr )
90102 downloadAnchor . setAttribute ( 'download' , `lazer_config_${ cluster } .json` )
@@ -142,7 +154,7 @@ const PythLazer = ({
142154 setIsSendProposalButtonLoading ( true )
143155 try {
144156 // 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
146158
147159 // Close the modal and show success notification
148160 setIsModalOpen ( false )
0 commit comments