mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-08 02:52:49 +00:00
refactor: update to Svelte 5 preview
feat: add charrecorder feat: dynamic os layouts for CC1
This commit is contained in:
@@ -3,15 +3,22 @@
|
||||
import type { KeyInfo } from "$lib/serial/keymap-codes";
|
||||
import LL from "$i18n/i18n-svelte";
|
||||
import Action from "$lib/components/Action.svelte";
|
||||
import type { MouseEventHandler } from "svelte/elements";
|
||||
|
||||
export let id: number | KeyInfo;
|
||||
let {
|
||||
id,
|
||||
onclick,
|
||||
}: { id: number | KeyInfo; onclick?: MouseEventHandler<HTMLButtonElement> } =
|
||||
$props();
|
||||
|
||||
$: key = (typeof id === "number" ? KEYMAP_CODES.get(id) ?? id : id) as
|
||||
| number
|
||||
| KeyInfo;
|
||||
let key = $derived(
|
||||
(typeof id === "number" ? KEYMAP_CODES.get(id) ?? id : id) as
|
||||
| number
|
||||
| KeyInfo,
|
||||
);
|
||||
</script>
|
||||
|
||||
<button on:click>
|
||||
<button {onclick}>
|
||||
{#if typeof key === "object"}
|
||||
<div class="title">
|
||||
<b>
|
||||
|
||||
Reference in New Issue
Block a user