88 FormField ,
99 FormItem ,
1010 FormLabel ,
11- FormMessage ,
11+ FormMessage
1212} from "@/components/ui/form" ;
1313import { Input , inputVariants } from "@/components/ui/input" ;
1414import { NavigateBackBtn } from "@/components/ui/navigate-back-btn" ;
@@ -22,7 +22,7 @@ import { useOperator } from "@/hooks/operator/use-operator";
2222import {
2323 getMevRelaysOptions ,
2424 SORTED_OPERATOR_METADATA_FIELDS ,
25- type OperatorMetadataFields ,
25+ type OperatorMetadataFields
2626} from "@/lib/utils/operator" ;
2727import { cn } from "@/lib/utils/tw" ;
2828import { dgkURLSchema , httpsURLSchema } from "@/lib/zod" ;
@@ -40,7 +40,7 @@ import { operatorLogoSchema } from "@/lib/zod/operator.ts";
4040import ImgCropUpload from "@/components/ui/ImgCropUpload.tsx" ;
4141
4242const sanitizedString = z . string ( ) . regex ( / ^ [ a - z A - Z 0 - 9 _ ! $ # ’ | \s ] * $ / , {
43- message : "Only letters, numbers, and special characters are allowed." ,
43+ message : "Only letters, numbers, and special characters are allowed."
4444} ) ;
4545
4646export const metadataScheme = z . object ( {
@@ -50,6 +50,7 @@ export const metadataScheme = z.object({
5050 . min ( 3 , "Operator name must be at least 3 characters" )
5151 . max ( 30 , "Operator name must be at most 30 characters" ) ,
5252 description : z . string ( ) . optional ( ) . default ( "" ) ,
53+ ssv_client : sanitizedString . optional ( ) . default ( "" ) ,
5354 eth1_node_client : sanitizedString . optional ( ) . default ( "" ) ,
5455 eth2_node_client : sanitizedString . optional ( ) . default ( "" ) ,
5556 location : z . string ( ) . optional ( ) . default ( "" ) ,
@@ -58,13 +59,13 @@ export const metadataScheme = z.object({
5859 twitter_url : z . union ( [ z . literal ( "" ) , httpsURLSchema ] ) ,
5960 website_url : z . union ( [ z . literal ( "" ) , httpsURLSchema ] ) ,
6061 linkedin_url : z . union ( [ z . literal ( "" ) , httpsURLSchema ] ) ,
61- dkg_address : z . union ( [ z . literal ( "" ) , dgkURLSchema ] ) ,
62+ dkg_address : z . union ( [ z . literal ( "" ) , dgkURLSchema ] )
6263} ) satisfies z . ZodObject < Record < OperatorMetadataFields , z . ZodTypeAny > > ;
6364
6465export const OperatorMetadata : FC < ComponentPropsWithoutRef < "div" > > = ( {
65- className,
66- ...props
67- } ) => {
66+ className,
67+ ...props
68+ } ) => {
6869 const navigate = useNavigate ( ) ;
6970 const sign = useSignOperatorMetadata ( ) ;
7071
@@ -78,15 +79,15 @@ export const OperatorMetadata: FC<ComponentPropsWithoutRef<"div">> = ({
7879 operator ?. mev_relays
7980 ?. split ( "," )
8081 . map ( ( val ) => val . trim ( ) )
81- . filter ( Boolean ) ?? [ ] ,
82+ . filter ( Boolean ) ?? [ ]
8283 } ;
8384
8485 const form = useForm <
8586 z . infer < typeof metadataScheme > & { mev_relays : string [ ] }
8687 > ( {
8788 mode : "all" ,
8889 defaultValues : defaults ,
89- resolver : zodResolver ( metadataScheme ) ,
90+ resolver : zodResolver ( metadataScheme )
9091 } ) ;
9192
9293 const isChange = ! isEqual ( defaults , form . getValues ( ) ) ;
@@ -107,7 +108,7 @@ export const OperatorMetadata: FC<ComponentPropsWithoutRef<"div">> = ({
107108 sign
108109 . submit ( operator ! . id . toString ( ) , {
109110 message,
110- metadata,
111+ metadata
111112 } )
112113 . then ( ( ) => {
113114 navigate ( ".." ) ;
@@ -214,7 +215,7 @@ export const OperatorMetadata: FC<ComponentPropsWithoutRef<"div">> = ({
214215 placeholder = "Select your server geolocation"
215216 options = { ( operatorLocations . data || [ ] ) . map ( ( country ) => ( {
216217 value : country . name ,
217- label : `${ country . name } (${ country [ "alpha-3" ] } )` ,
218+ label : `${ country . name } (${ country [ "alpha-3" ] } )`
218219 } ) ) }
219220 />
220221 </ FormControl >
@@ -223,6 +224,31 @@ export const OperatorMetadata: FC<ComponentPropsWithoutRef<"div">> = ({
223224 ) }
224225 />
225226
227+ < FormField
228+ control = { form . control }
229+ name = "ssv_client"
230+ render = { ( { field } ) => (
231+ < FormItem >
232+ < FormLabel > SSV Client</ FormLabel >
233+ < FormControl >
234+ < Combobox
235+ value = { field . value }
236+ onChange = { ( value ) => field . onChange ( value ) }
237+ placeholder = "Add your SSV Client"
238+ options = { [ "SSV Node" , "Anchor" ] . map (
239+ ( node ) => ( {
240+ value : node ,
241+ label : node
242+ } )
243+ ) }
244+ className = { inputVariants ( { className : "text-base" } ) }
245+ />
246+ </ FormControl >
247+ < FormMessage />
248+ </ FormItem >
249+ ) }
250+ />
251+
226252 < FormField
227253 control = { form . control }
228254 name = "eth1_node_client"
@@ -237,8 +263,8 @@ export const OperatorMetadata: FC<ComponentPropsWithoutRef<"div">> = ({
237263 options = { [ "Erigon" , "Besu" , "Nethermind" , "Geth" ] . map (
238264 ( node ) => ( {
239265 value : node ,
240- label : node ,
241- } ) ,
266+ label : node
267+ } )
242268 ) }
243269 className = { inputVariants ( { className : "text-base" } ) }
244270 />
@@ -263,10 +289,10 @@ export const OperatorMetadata: FC<ComponentPropsWithoutRef<"div">> = ({
263289 "Nimbus" ,
264290 "Teku" ,
265291 "Lighthouse" ,
266- "Prysm" ,
292+ "Prysm"
267293 ] . map ( ( node ) => ( {
268294 value : node ,
269- label : node ,
295+ label : node
270296 } ) ) }
271297 className = { inputVariants ( { className : "text-base" } ) }
272298 />
0 commit comments