) => void;
}) {
const elev = level.kind === "elevation";
const eff = effectiveSectionLook(level, marksOfPlan(project, planLevelId, elev));
const icon = (key: string) => (elev ? ELEVATION_ICONS[key] : undefined) ?? ICONS[key];
const modes: SectionLineMode[] = ["full", "ends", "none"];
const markers: SectionMarker[] = elev ? ["triangle", "arrow", "none"] : ["arrow", "lAngle", "triangle", "none"];
const ats: SectionMarkerAt[] = ["both", "start", "end"];
const pens = project.pens ?? [];
const penSet = project.penSets?.find((s) => s.id === project.activePenSetId);
const overridden = [level.lineMode, level.endLengthMm, level.lineStyleId, level.linePenId, level.marker, level.markerAt, level.markerLabel].some((v) => v !== undefined);
return (
<>
{t("objinfo.sectionLine.look")}
{lbl("line")}
onPatch({ lineMode: v })}
options={modes.map((m) => ({ value: m, label: lbl(m), icon: icon(`line:${m}`) }))}
/>
{eff.lineMode !== "none" && (
<>
{eff.lineMode === "ends" && (
{lbl("endLength")}
{
const v = Number(e.target.value);
if (Number.isFinite(v) && v > 0) onPatch({ endLengthMm: v });
}}
title={lbl("endLength")}
/>
)}
{lbl("lineStyle")}
onPatch({ lineStyleId: v === "" ? undefined : v })}
options={[{ value: "", label: t("attr.lineStyle.none") }, ...project.lineStyles.map((l) => ({ value: l.id, label: l.name }))]}
title={lbl("lineStyle")}
width={150}
/>
>
)}
{lbl("pen")}
onPatch({ linePenId: v === "" ? undefined : v })}
options={[
{ value: "", label: t("attr.lineStyle.none") },
...pens.map((p) => {
const w = penSet?.pens[p.id]?.weight;
return { value: p.id, label: w ? `${p.name} · ${w} mm` : p.name };
}),
]}
title={lbl("pen")}
width={150}
/>
{lbl("marker")}
onPatch({ marker: v })}
options={markers.map((m) => ({ value: m, label: lbl(m), icon: icon(`marker:${m}`) }))}
/>
{!elev && eff.marker !== "none" && (
{lbl("markerAt")}
onPatch({ markerAt: v })}
options={ats.map((m) => ({ value: m, label: lbl(m), icon: icon(`at:${m}`) }))}
/>
)}
{lbl("label")}
onPatch({ markerLabel: e.target.checked })} title={lbl("label")} />
{overridden && (
)}
>
);
}