Skip to content

Commit

Permalink
feat: rename ref interface
Browse files Browse the repository at this point in the history
  • Loading branch information
BenElferink committed Feb 10, 2025
1 parent 7becedf commit 6906d8e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/containers/source-modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useModalStore } from '../../store'
import { ENTITY_TYPES, useKeyDown } from '@odigos/ui-utils'
import type { Namespace, PersistSources } from '../../@types'
import { Modal, NavigationButtons } from '@odigos/ui-components'
import { FormRef, SourceSelectionForm, type SourceSelectionFormProps } from '../source-selection-form'
import { SourceSelectionForm, type SourceSelectionFormRef, type SourceSelectionFormProps } from '../source-selection-form'

interface SourceModalProps {
componentType?: SourceSelectionFormProps['componentType']
Expand Down Expand Up @@ -44,7 +44,7 @@ const SourceModal: FC<SourceModalProps> = ({
}
}

const formRef = useRef<FormRef>(null)
const formRef = useRef<SourceSelectionFormRef>(null)
useKeyDown({ key: 'Enter', active: isOpen }, handleSubmit)

return (
Expand Down
6 changes: 3 additions & 3 deletions src/containers/source-selection-form/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ interface SourceSelectionFormProps {
onSelectNamespace: (namespace: string) => void
}

interface FormRef {
interface SourceSelectionFormRef {
getFormValues: () => {
initial: AvailableSourcesByNamespace
apps: SourceSelectionFormData
futureApps: NamespaceSelectionFormData
}
}

const SourceSelectionForm = forwardRef<FormRef, SourceSelectionFormProps>(
const SourceSelectionForm = forwardRef<SourceSelectionFormRef, SourceSelectionFormProps>(
({ componentType, isModal, namespaces, namespace, namespacesLoading, selectedNamespace, onSelectNamespace }, ref) => {
const formState = useSourceSelectionFormData({ namespaces, namespace, selectedNamespace, onSelectNamespace })
const { recordedInitialSources, getApiSourcesPayload, getApiFutureAppsPayload } = formState
Expand Down Expand Up @@ -67,4 +67,4 @@ const SourceSelectionForm = forwardRef<FormRef, SourceSelectionFormProps>(
}
)

export { SourceSelectionForm, type SourceSelectionFormProps, type FormRef }
export { SourceSelectionForm, type SourceSelectionFormProps, type SourceSelectionFormRef }

0 comments on commit 6906d8e

Please sign in to comment.