11import { FC } from 'react'
22import { getRuntimeTxMethodOptions } from '../RuntimeTransactionMethod'
33import { useTranslation } from 'react-i18next'
4- import { Select } from '../Select'
4+ import { Select , SelectOptionBase } from '../Select'
55import Typography from '@mui/material/Typography'
66import { Layer } from '../../../oasis-nexus/api'
77
@@ -28,14 +28,20 @@ export const RuntimeTransactionTypeFilter: FC<{
2828 value : string
2929 setValue : ( value : string ) => void
3030 expand ?: boolean
31- } > = ( { layer, value, setValue, expand } ) => {
31+ customOptions ?: SelectOptionBase [ ]
32+ } > = ( { layer, value, setValue, expand, customOptions } ) => {
3233 const { t } = useTranslation ( )
34+ const defaultOptions = [ { value : 'any' , label : 'Any' } ]
35+ const options = customOptions
36+ ? [ ...defaultOptions , ...customOptions ]
37+ : [ ...defaultOptions , ...getRuntimeTxMethodOptions ( t , layer ) ]
38+
3339 return (
3440 < Select
3541 className = { expand ? 'expand' : undefined }
3642 light = { true }
3743 label = { < FilterLabel /> }
38- options = { [ { value : 'any' , label : 'Any' } , ... getRuntimeTxMethodOptions ( t , layer ) ] }
44+ options = { options }
3945 value = { value }
4046 handleChange = { setValue as any }
4147 />
0 commit comments