Files
CT/src/View/Components/ribbonButton.tsx
T

26 lines
626 B
TypeScript
Raw Normal View History

2024-07-23 15:41:03 +02:00
import * as React from "bloatless-react";
import BoardViewModel, {
2026-04-01 08:29:39 +00:00
BoardPageType,
2024-07-23 15:41:03 +02:00
} from "../../ViewModel/Pages/boardViewModel";
export function RibbonButton(
2026-04-01 08:29:39 +00:00
label: string,
icon: string,
isSelected: React.State<boolean>,
select: () => void,
isHighlighted: React.State<boolean> = new React.State(false),
2024-07-23 15:41:03 +02:00
) {
2026-04-01 08:29:39 +00:00
return (
<button
class="ribbon-button"
aria-label={label}
toggle:selected={isSelected}
toggle:highlight={isHighlighted}
2026-04-01 08:29:39 +00:00
on:click={select}
>
<span class="icon">{icon}</span>
</button>
);
2024-07-23 15:41:03 +02:00
}