fix: retain editable investment plans and record partial QA continuity evidence
This commit is contained in:
@@ -9,6 +9,17 @@ import {
|
||||
} from '@/lib/company-comparison';
|
||||
|
||||
type Question = { label: string; options: Record<string, string> };
|
||||
const questionThemes: Record<string, string> = {
|
||||
purpose: 'Organização do pedido',
|
||||
participants: 'Titulares, sócios e accionistas',
|
||||
participation: 'Participações',
|
||||
capital: 'Capital e contribuições',
|
||||
management: 'Gestão',
|
||||
responsibility: 'Responsabilidade limitada',
|
||||
listing: 'Negociação em Bolsa',
|
||||
regulated: 'Regras profissionais ou sectoriais',
|
||||
preferred: 'Alternativa a aprofundar',
|
||||
};
|
||||
type Result = {
|
||||
engine_version: string;
|
||||
source: {
|
||||
@@ -135,8 +146,8 @@ function Comparator(props: Props) {
|
||||
</p>
|
||||
)}
|
||||
<p>
|
||||
Compare a estrutura pretendida e os pontos a esclarecer antes de
|
||||
preparar o acto constitutivo.
|
||||
Compare alternativas para discutir a constituição; não existe
|
||||
uma forma universalmente preferível.
|
||||
</p>
|
||||
{saved && (
|
||||
<p>
|
||||
@@ -178,32 +189,46 @@ function Comparator(props: Props) {
|
||||
{Object.entries(definition.questions).map(
|
||||
([key, question]) =>
|
||||
active.includes(key) ? (
|
||||
<label key={key} className="grid gap-1">
|
||||
{question.label}
|
||||
<select
|
||||
className={input}
|
||||
name={`answers[${key}]`}
|
||||
value={answers[key] ?? 'unknown'}
|
||||
disabled={busy}
|
||||
onChange={(e) => {
|
||||
setAnswers({
|
||||
...answers,
|
||||
[key]: e.target.value,
|
||||
});
|
||||
setDirty(true);
|
||||
operation.current =
|
||||
createOperationKey();
|
||||
}}
|
||||
>
|
||||
{Object.entries(
|
||||
question.options,
|
||||
).map(([code, label]) => (
|
||||
<option key={code} value={code}>
|
||||
{label}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</label>
|
||||
<fieldset
|
||||
key={key}
|
||||
className="min-w-0 rounded border p-3"
|
||||
>
|
||||
<legend className="px-1 font-semibold">
|
||||
{questionThemes[key] ??
|
||||
question.label}
|
||||
</legend>
|
||||
<label className="grid gap-1">
|
||||
{question.label}
|
||||
<select
|
||||
className={input}
|
||||
name={`answers[${key}]`}
|
||||
value={
|
||||
answers[key] ?? 'unknown'
|
||||
}
|
||||
disabled={busy}
|
||||
onChange={(e) => {
|
||||
setAnswers({
|
||||
...answers,
|
||||
[key]: e.target.value,
|
||||
});
|
||||
setDirty(true);
|
||||
operation.current =
|
||||
createOperationKey();
|
||||
}}
|
||||
>
|
||||
{Object.entries(
|
||||
question.options,
|
||||
).map(([code, label]) => (
|
||||
<option
|
||||
key={code}
|
||||
value={code}
|
||||
>
|
||||
{label}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</label>
|
||||
</fieldset>
|
||||
) : (
|
||||
<input
|
||||
key={key}
|
||||
|
||||
Reference in New Issue
Block a user