diff --git a/src/components/wizard/BackendSelectionStep.tsx b/src/components/wizard/BackendSelectionStep.tsx index 1bceaed..0d99da3 100644 --- a/src/components/wizard/BackendSelectionStep.tsx +++ b/src/components/wizard/BackendSelectionStep.tsx @@ -4,6 +4,7 @@ import { zodResolver } from '@hookform/resolvers/zod'; import { z } from 'zod'; import { useWizard } from '../../store/context'; import type { BackendType } from '../../store/types'; +import { BACKEND_REGISTRY } from '../../schemas/registry'; import { BackendCard } from '../ui/BackendCard'; const remoteNameSchema = z.object({ @@ -18,23 +19,6 @@ const remoteNameSchema = z.object({ type RemoteNameFormValues = z.infer; -const BACKENDS: { type: BackendType; name: string; description: string }[] = [ - { - type: 'azureblob', - name: 'Azure Blob Storage', - description: 'Microsoft Azure cloud storage', - }, - { - type: 's3', - name: 'Amazon S3', - description: 'AWS Simple Storage Service', - }, - { - type: 's3-compatible', - name: 'S3-Compatible', - description: 'Wasabi, MinIO, Cloudflare R2, and others', - }, -]; export function BackendSelectionStep() { const { state, dispatch } = useWizard(); @@ -77,13 +61,13 @@ export function BackendSelectionStep() { )}
- {BACKENDS.map((backend) => ( + {Object.entries(BACKEND_REGISTRY).map(([type, entry]) => ( handleCardClick(backend.type)} + key={type} + name={entry.displayName} + description={entry.description} + selected={state.remote.backendType === type} + onClick={() => handleCardClick(type as BackendType)} /> ))}
diff --git a/src/schemas/index.ts b/src/schemas/index.ts index 5f9f5ff..238fd1e 100644 --- a/src/schemas/index.ts +++ b/src/schemas/index.ts @@ -23,6 +23,3 @@ export const BACKEND_SCHEMAS = { 's3-compatible': buildZodSchema('s3-compatible'), } as const; -// Utility type: infer TypeScript type from a backend's Zod schema -export type BackendFormValues = - z.infer;