Skip to content

Commit 58ee89f

Browse files
committed
SHow title instead of name
1 parent 8e86470 commit 58ee89f

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

dashi/src/app/PanelsControl.tsx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,23 @@ import { ContribPoint } from "../model/extension";
88
const contribPoint: ContribPoint = "panels";
99

1010
function PanelsControl() {
11-
const contributionModelsRecord = useAppStore(
12-
(state) => state.contributionModelsRecord,
13-
);
1411
const contributionStatesRecord = useAppStore(
1512
(state) => state.contributionStatesRecord,
1613
);
17-
const panelModels = contributionModelsRecord[contribPoint];
1814
const panelStates = contributionStatesRecord[contribPoint];
19-
if (!panelModels || !panelStates) {
15+
if (!panelStates) {
2016
// Ok, not ready yet
2117
return null;
2218
}
23-
// TODO: assert panelModels.length === panelStates.length
24-
if (panelModels.length != panelStates?.length) {
25-
throw Error("internal state error");
26-
}
2719

2820
return (
29-
<FormGroup>
21+
<FormGroup sx={{ display: "flex", flexDirection: "row" }}>
3022
{panelStates.map((panelState, panelIndex) => {
3123
const id = `panels.${panelIndex}`;
3224
return (
3325
<FormControlLabel
3426
key={panelIndex}
35-
label={panelModels[panelIndex].name}
27+
label={panelState.title}
3628
control={
3729
<Checkbox
3830
color="secondary"

0 commit comments

Comments
 (0)