Reescrita dos geradores: biblioteca IGenerator, minimal API e novo frontend
- GeradoresService: cada tipo passa a ser um IGenerator (NIF, NIPC, NISS, CC, passaporte, IBAN, NIB, cartões, referência MB, pessoa, telefone, código postal, email, matrícula, EAN, UUID) registado em GeneratorRegistry; remove DAL/EF - GeradoresWS: minimal APIs em /api/v1 com OpenAPI + Scalar e health check - UnitTest: testes de ida e volta, valores conhecidos, detecção e API - geradoresfe: UI construída a partir dos metadados da API, validador livre, exportação CSV/JSON/TXT, nginx com API_UPSTREAM configurável - Docker, docker-compose e Jenkinsfile actualizados Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
25
geradoresfe/src/components/OptionsForm.tsx
Normal file
25
geradoresfe/src/components/OptionsForm.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
import type { Generator } from "../lib/api";
|
||||
import { Select } from "./ui/Select";
|
||||
|
||||
type OptionsFormProps = {
|
||||
generator: Generator;
|
||||
values: Record<string, string>;
|
||||
onChange: (key: string, value: string) => void;
|
||||
};
|
||||
|
||||
export function OptionsForm({ generator, values, onChange }: OptionsFormProps) {
|
||||
if (generator.options.length === 0) return null;
|
||||
return (
|
||||
<div className="grid gap-3">
|
||||
{generator.options.map((option) => (
|
||||
<Select
|
||||
key={option.key}
|
||||
label={option.label}
|
||||
options={option.choices}
|
||||
value={values[option.key] ?? option.defaultValue}
|
||||
onChange={(v) => onChange(option.key, v)}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user