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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user