mirror of
https://github.com/zadam/trilium.git
synced 2025-11-12 16:25:51 +01:00
chore(react/collections): fix the rest of client type errors
This commit is contained in:
@@ -148,19 +148,12 @@ export function TouchBarButton({ label, icon, click, enabled }: ButtonProps) {
|
||||
|
||||
export function TouchBarSegmentedControl({ mode, segments, selectedIndex, onChange }: SegmentedControlProps) {
|
||||
const api = useContext(TouchBarContext);
|
||||
const processedSegments = segments.map((segment) => {
|
||||
if (segment.icon) {
|
||||
if (!api) return undefined;
|
||||
return {
|
||||
...segment,
|
||||
icon: buildIcon(api?.nativeImage, segment.icon)
|
||||
}
|
||||
} else {
|
||||
return segment;
|
||||
}
|
||||
});
|
||||
|
||||
if (api) {
|
||||
const processedSegments: Electron.SegmentedControlSegment[] = segments.map(({icon, ...restProps}) => ({
|
||||
...restProps,
|
||||
icon: icon ? buildIcon(api.nativeImage, icon) : undefined
|
||||
}));
|
||||
const item = new api.TouchBar.TouchBarSegmentedControl({
|
||||
mode, selectedIndex,
|
||||
segments: processedSegments,
|
||||
|
||||
Reference in New Issue
Block a user