feat(05-01): wire BackendSelectionStep to registry and remove dead export

- Replace hardcoded BACKENDS array with Object.entries(BACKEND_REGISTRY)
- Import BACKEND_REGISTRY in BackendSelectionStep.tsx
- Remove BackendFormValues<T> export from schemas/index.ts (dead code TECH-04)
- TypeScript compiles with zero errors
This commit is contained in:
2026-03-30 09:38:25 +02:00
parent 214a68e4eb
commit 52318d5130
2 changed files with 7 additions and 26 deletions
+7 -23
View File
@@ -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<typeof remoteNameSchema>;
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() {
)}
</div>
<div data-testid="backend-cards">
{BACKENDS.map((backend) => (
{Object.entries(BACKEND_REGISTRY).map(([type, entry]) => (
<BackendCard
key={backend.type}
name={backend.name}
description={backend.description}
selected={state.remote.backendType === backend.type}
onClick={() => handleCardClick(backend.type)}
key={type}
name={entry.displayName}
description={entry.description}
selected={state.remote.backendType === type}
onClick={() => handleCardClick(type as BackendType)}
/>
))}
</div>