'use client' import { useState } from 'react' import { TeamContext } from '@/lib/types' interface ContextFormProps { onSubmit: (context: TeamContext) => void onBack: () => void } const defaultContext: TeamContext = { architecture: 'monolith', releaseStrategy: 'scheduled', hasComplianceConstraints: false, } export default function ContextForm({ onSubmit, onBack }: ContextFormProps) { const [context, setContext] = useState(defaultContext) function handleSubmit(e: React.FormEvent) { e.preventDefault() onSubmit(context) } function setField(key: K, value: TeamContext[K]) { setContext((prev) => ({ ...prev, [key]: value })) } return (
Architecture
{( [ { value: 'monolith', label: 'Monolith' }, { value: 'microservices', label: 'Microservices' }, { value: 'hybrid', label: 'Hybrid' }, ] as const ).map(({ value, label }) => ( ))}
Release Strategy
{( [ { value: 'continuous', label: 'Continuous delivery' }, { value: 'scheduled', label: 'Scheduled releases' }, { value: 'mixed', label: 'Mixed' }, ] as const ).map(({ value, label }) => ( ))}
) }