Släktträd och tidslinje
Relationer får ett släktband (förälder, partner, syskon) och en period. Nytt släktträd som ritas av släktbanden, och en tidslinje som samlar födelse och död, scenarier, egna händelser och relationsperioder med ålder vid varje tillfälle. Datum skrivs som ÅÅÅÅ, ÅÅÅÅ-MM eller ÅÅÅÅ-MM-DD. Följer med i export, import och papperskorg. Migreringen 0006 ger gamla relationer som "Förälder till" rätt släktband. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
dcb5d43429
commit
bd269d70a5
32 files changed
+2285
-25
No files matched your search
@@ -0,0 +1,42 @@
|
||||
import type { TFunction } from "@/i18n/core";
|
||||
import { FAMILY_BONDS, type FamilyBondKind } from "@/lib/family";
|
||||
import { StoryDateInput } from "./story-date-input";
|
||||
|
||||
/** Släktband och period för en relation. Används av formuläret för ny relation och av redigeringssidan. */
|
||||
export function RelationBondFields({
|
||||
t,
|
||||
bond,
|
||||
startDate,
|
||||
endDate,
|
||||
}: {
|
||||
t: TFunction;
|
||||
bond?: FamilyBondKind | null;
|
||||
startDate?: string | null;
|
||||
endDate?: string | null;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<div className="col-12">
|
||||
<label className="form-label">{t("relation.bond")}</label>
|
||||
<select name="bond" className="form-select" defaultValue={bond ?? ""}>
|
||||
<option value="">{t("relation.bondNone")}</option>
|
||||
{FAMILY_BONDS.map((b) => (
|
||||
<option key={b} value={b}>
|
||||
{t(`relation.bond.${b}`)}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
<div className="form-hint">{t("relation.bondHelp")}</div>
|
||||
</div>
|
||||
<div className="col-md-6">
|
||||
<label className="form-label">{t("relation.startDate")}</label>
|
||||
<StoryDateInput name="startDate" defaultValue={startDate} />
|
||||
</div>
|
||||
<div className="col-md-6">
|
||||
<label className="form-label">{t("relation.endDate")}</label>
|
||||
<StoryDateInput name="endDate" defaultValue={endDate} />
|
||||
</div>
|
||||
<div className="col-12 form-hint mt-0">{t("relation.datesHelp")}</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user