more toolbar buttons

This commit is contained in:
Joeri Exelmans 2025-10-14 19:02:17 +02:00
parent 63265c2b4c
commit 39a229bf21
2 changed files with 8 additions and 7 deletions

View file

@ -112,7 +112,7 @@ export function App() {
paddingLeft: 1,
}}>
<AST {...{...ast, rt: rt.at(rtIdx!)}}/>
<hr/>
<br/>
<RTHistory {...{ast, rt, rtIdx, setTime, setRTIdx}}/>
</Box>
</Stack>

View file

@ -102,13 +102,14 @@ export function TopPanel({rt, time, setTime, onInit, onClear, onRaise, ast, mode
return <>
<div className="toolbar">
{([
["and", <RountangleIcon kind="and"/>],
["or", <RountangleIcon kind="or"/>],
["pseudo", <PseudoStateIcon/>],
["transition", <TrendingFlatIcon fontSize="small"/>],
["text", <>T</>],
] as [InsertMode, ReactElement][]).map(([m, buttonTxt]) =>
["and", "AND-states", <RountangleIcon kind="and"/>],
["or", "OR-states", <RountangleIcon kind="or"/>],
["pseudo", "pseudo-states", <PseudoStateIcon/>],
["transition", "transitions", <TrendingFlatIcon fontSize="small"/>],
["text", "text", <>T</>],
] as [InsertMode, string, ReactElement][]).map(([m, hint, buttonTxt]) =>
<button
title={"insert "+hint}
disabled={mode===m}
onClick={() => setMode(m)}
>{buttonTxt}</button>)}