@@ -25,6 +25,7 @@ import {
2525 type InstanceCreate ,
2626 type InstanceDiskAttachment ,
2727 type NameOrId ,
28+ type SiloIpPool ,
2829} from '@oxide/api'
2930import {
3031 Images16Icon ,
@@ -46,6 +47,7 @@ import {
4647} from '~/components/form/fields/DisksTableField'
4748import { FileField } from '~/components/form/fields/FileField'
4849import { BootDiskImageSelectField as ImageSelectField } from '~/components/form/fields/ImageSelectField'
50+ import { toIpPoolItem } from '~/components/form/fields/ip-pool-item'
4951import { NameField } from '~/components/form/fields/NameField'
5052import { NetworkInterfaceField } from '~/components/form/fields/NetworkInterfaceField'
5153import { NumberField } from '~/components/form/fields/NumberField'
@@ -57,7 +59,6 @@ import { FullPageForm } from '~/components/form/FullPageForm'
5759import { HL } from '~/components/HL'
5860import { getProjectSelector , useProjectSelector } from '~/hooks/use-params'
5961import { addToast } from '~/stores/toast'
60- import { Badge } from '~/ui/lib/Badge'
6162import { Button } from '~/ui/lib/Button'
6263import { Checkbox } from '~/ui/lib/Checkbox'
6364import { toComboboxItems } from '~/ui/lib/Combobox'
@@ -609,7 +610,7 @@ const AdvancedAccordion = ({
609610} : {
610611 control : Control < InstanceCreateInput >
611612 isSubmitting : boolean
612- siloPools : Array < { name : string ; isDefault : boolean } >
613+ siloPools : Array < SiloIpPool >
613614} ) => {
614615 // we track this state manually for the sole reason that we need to be able to
615616 // tell, inside AccordionItem, when an accordion is opened so we can scroll its
@@ -733,17 +734,7 @@ const AdvancedAccordion = ({
733734 label = "IP pool for ephemeral IP"
734735 placeholder = { defaultPool ? `${ defaultPool } (default)` : 'Select a pool' }
735736 selected = { `${ siloPools . find ( ( pool ) => pool . name === selectedPool ) ?. name } ` }
736- items = {
737- siloPools . map ( ( pool ) => ( {
738- label : (
739- < div className = "flex items-center gap-2" >
740- { pool . name }
741- { pool . isDefault && < Badge > default</ Badge > }
742- </ div >
743- ) ,
744- value : pool . name ,
745- } ) ) || [ ]
746- }
737+ items = { siloPools . map ( toIpPoolItem ) }
747738 disabled = { ! assignEphemeralIp || isSubmitting }
748739 required
749740 onChange = { ( value ) => {
0 commit comments