1- import React , { useEffect } from 'react' ;
1+ import React , { useEffect , useState } from 'react' ;
22import { Form , Input , Select , Tooltip } from 'antd' ;
33import { QuestionCircleOutlined , InfoCircleOutlined , UserOutlined , KeyOutlined , UploadOutlined } from '@ant-design/icons' ;
44import useGenericSettings from '@app/hooks/useGenericSettings' ;
@@ -10,7 +10,7 @@ const { TextArea } = Input;
1010
1111const RelayInfoSettings : React . FC = ( ) => {
1212 const { settings, loading, error, fetchSettings, updateSettings, saveSettings } = useGenericSettings ( 'relay_info' ) ;
13-
13+ const [ image , setImage ] = useState < string | null > ( null ) ;
1414 const [ form ] = Form . useForm ( ) ;
1515
1616 // Update form values when settings change
@@ -25,6 +25,10 @@ const RelayInfoSettings: React.FC = () => {
2525 updateSettings ( changedValues ) ;
2626 } ;
2727
28+ const onUploadIcon = ( url : string ) => { // use as onUploadIcon prop in Upload Component
29+ setImage ( url ) ;
30+ } ;
31+
2832 // Common NIPs that relays might support
2933 const nipOptions = [
3034 { value : 1 , label : 'NIP-01: Basic protocol flow' } ,
@@ -86,6 +90,9 @@ const RelayInfoSettings: React.FC = () => {
8690 < S . InputFieldWithPrefix
8791 suffix = { < S . UploadButton size = 'small' aria-label = 'Upload Relay Icon' icon = { < UploadOutlined /> } > Upload Relay Icon</ S . UploadButton > }
8892 />
93+ { image && (
94+ < S . UploadedImageWrapper > < img src = { image } alt = "" /> </ S . UploadedImageWrapper >
95+ ) }
8996 </ Form . Item >
9097 < Form . Item
9198 name = "relaydescription"
0 commit comments