@@ -4,7 +4,6 @@ import { CreateFormHeader } from './CreateFormHeader';
44import { CreateFormNavigation } from './CreateFormNavigation' ;
55import { zodResolver } from '@hookform/resolvers/zod' ;
66import { Controller , useForm } from 'react-hook-form' ;
7- import { InputFormField } from './InputFormField' ;
87import { Label } from '@oasisprotocol/ui-library/src/components/ui/label' ;
98import {
109 RadioGroup ,
@@ -14,6 +13,8 @@ import { buildFormSchema, type BuildFormData } from './types';
1413import { SelectFormField } from './SelectFormField' ;
1514import { useGetRosePrice } from '../../coin-gecko/api' ;
1615import { Skeleton } from '@oasisprotocol/ui-library/src/components/ui/skeleton' ;
16+ import { useNetwork } from '../../hooks/useNetwork' ;
17+ import { useGetRuntimeRoflmarketProviders } from '../../nexus/api' ;
1718
1819type AgentStepProps = {
1920 handleNext : ( ) => void ;
@@ -51,6 +52,18 @@ export const BuildStep: FC<AgentStepProps> = ({
5152 setAppDataForm,
5253 selectedTemplateName,
5354} ) => {
55+ const network = useNetwork ( ) ;
56+ const providersQuery = useGetRuntimeRoflmarketProviders ( network , 'sapphire' ) ;
57+ const { data } = providersQuery ;
58+ const providers = data ?. data . providers ;
59+ const providerOptions = providers
60+ ? providers ?. map ( ( provider ) => ( {
61+ value : provider . address ,
62+ label :
63+ ( provider . metadata [ 'net.oasis.provider.name' ] as string ) ||
64+ provider . address ,
65+ } ) )
66+ : [ ] ;
5467 const {
5568 data : rosePrice ,
5669 isLoading : isLoadingRosePrice ,
@@ -99,19 +112,12 @@ export const BuildStep: FC<AgentStepProps> = ({
99112 onSubmit = { form . handleSubmit ( onSubmit ) }
100113 className = "space-y-6 mb-6 w-full"
101114 >
102- < InputFormField
103- control = { form . control }
104- name = "artifacts"
105- label = "Base Artifacts"
106- placeholder = "oasis boot 0.5.0, ROFL container 0.5.1"
107- />
108-
109115 < SelectFormField
110116 control = { form . control }
111117 name = "provider"
112118 label = "Provider"
113119 placeholder = "Select provider"
114- options = { [ { value : 'OPF' , label : 'OPF' } ] }
120+ options = { [ ... providerOptions ] }
115121 />
116122
117123 < div className = "grid gap-2" >
0 commit comments