(false);
const block = "label" in displayForm ? displayForm.form : displayForm;
const chosenPersInf = "mascSing" in block
? block[persInf]
: block;
const form = "long" in chosenPersInf
? chosenPersInf[length] || chosenPersInf.short
: chosenPersInf;
useEffect(() => {
if (length === "mini" && !("mini" in chosenPersInf)) {
setLength(defaultLength);
}
// setPersInf("mascSing");
// setShowingExplanation(false);
}, [block, length, chosenPersInf, defaultLength]);
// TODO: This could be handled better to avoid the react-hooks/exhaustive-deps warning ?
useEffect(() => {
setShowingExplanation(false);
}, [block]);
const hasVariations = (!("masc" in form)) && (!("p" in form)) && (!isSentenceForm(form)) && !isAllOne(form as T.VerbBlock | T.ImperativeBlock);
return <>
{(("label" in displayForm && info) && showingFormInfo) && <>
{(hasVariations || displayForm.past) &&
{agreementInfo(info, displayForm)}
}
Formula: {displayForm.formula}
{showingExplanation &&
{displayForm.explanation}
}
>}
{"long" in chosenPersInf &&
setLength(p as T.Length)}
/>
}
{("mascSing" in block && info) && setPersInf(p)}
transitivity={info.transitivity}
/>}
{"masc" in form ?
: "p" in form ?
:
}
>
}
export default VerbFormDisplay;