diff --git a/packages/manager/src/components/Autocomplete/Autocomplete.tsx b/packages/manager/src/components/Autocomplete/Autocomplete.tsx index 86a20cb3f42..8fe72590532 100644 --- a/packages/manager/src/components/Autocomplete/Autocomplete.tsx +++ b/packages/manager/src/components/Autocomplete/Autocomplete.tsx @@ -16,12 +16,6 @@ import { import type { AutocompleteProps } from '@mui/material/Autocomplete'; -export interface Item { - data?: any; - label: L; - value: T; -} - export interface EnhancedAutocompleteProps< T extends { label: string }, Multiple extends boolean | undefined = undefined, diff --git a/packages/manager/src/features/Kubernetes/CreateCluster/CreateCluster.tsx b/packages/manager/src/features/Kubernetes/CreateCluster/CreateCluster.tsx index f1491dd8759..80b01ce9068 100644 --- a/packages/manager/src/features/Kubernetes/CreateCluster/CreateCluster.tsx +++ b/packages/manager/src/features/Kubernetes/CreateCluster/CreateCluster.tsx @@ -56,7 +56,6 @@ import type { KubeNodePoolResponse, } from '@linode/api-v4/lib/kubernetes'; import type { APIError } from '@linode/api-v4/lib/types'; -import type { Item } from 'src/components/Autocomplete/Autocomplete'; export const CreateCluster = () => { const { classes } = useStyles(); @@ -65,7 +64,7 @@ export const CreateCluster = () => { >(); const [nodePools, setNodePools] = React.useState([]); const [label, setLabel] = React.useState(); - const [version, setVersion] = React.useState | undefined>(); + const [version, setVersion] = React.useState(); const [errors, setErrors] = React.useState(); const [submitting, setSubmitting] = React.useState(false); const [hasAgreed, setAgreed] = React.useState(false); @@ -113,7 +112,7 @@ export const CreateCluster = () => { React.useEffect(() => { if (versions.length > 0) { - setVersion(getLatestVersion(versions)); + setVersion(getLatestVersion(versions).value); } }, [versionData]); @@ -121,7 +120,7 @@ export const CreateCluster = () => { const { push } = history; setErrors(undefined); setSubmitting(true); - const k8s_version = version ? version.value : undefined; + const k8s_version = version ?? undefined; // Only type and count to the API. const node_pools = nodePools.map( @@ -245,18 +244,15 @@ export const CreateCluster = () => { - option.value === value.value - } - onChange={(_, selected: Item) => { - setVersion(selected); + onChange={(_, selected) => { + setVersion(selected?.value); }} disableClearable={!!version} errorText={errorMap.k8s_version} label="Kubernetes Version" options={versions} placeholder={' '} - value={version ?? null} + value={versions.find((v) => v.value === version) ?? null} /> {showHighAvailability ? (