feat: add accordion overlay controls and icon API

This commit is contained in:
2026-03-06 16:28:03 +01:00
parent 027027b203
commit 35358c2d4e
16 changed files with 359 additions and 46 deletions

View File

@@ -2,6 +2,7 @@ import {invokeCommand} from "../../../shared/tauri/invoke";
import type {
CountdownCommand,
CountdownPayload,
OverlayConfigPayload,
CountdownSnapshot,
CountdownSnapshotDto
} from "../model/countdown.types";
@@ -50,3 +51,18 @@ export async function resetCountdown(id: number): Promise<void> {
export async function fetchCountdownSnapshot(id: number): Promise<CountdownSnapshot> {
return mapSnapshotDtoToSnapshot(await invokeCommand<CountdownSnapshotDto>("countdown_snapshot", {id}));
}
export async function setOverlayConfig(
id: number,
icon: string,
textColor: string,
bgColor: string,
): Promise<void> {
const payload: OverlayConfigPayload = {
id,
icon,
text_color: textColor,
bg_color: bgColor,
};
await invokeCommand<void>("set_overlay_config", payload);
}