(props: P)
| 640 | |
| 641 | function ScreenSelector() { |
| 642 | function Screen<P extends { name: string; display_name: string; selected?: boolean }>(props: P) { |
| 643 | const [preview] = createInvokeResource<string>("preview_screen", { deviceName: props.name }); |
| 644 | |
| 645 | return <button class={`rounded p-2 outline outline-0 ${props.selected ? "bg-blue-50 !outline-2 outline-blue-300" : "hover:bg-blue-50 hover:outline-2 hover:outline-gray-300"}`} |
| 646 | onClick={(_) => { |
| 647 | set_screen(props.name); |
| 648 | }}> |
| 649 | <img class="max-w-64 rounded" src={`data:image/png;base64,${preview()}`}/> |
| 650 | <span class="text-sm">{props.display_name}</span> |
| 651 | </button> |
| 652 | } |
| 653 | return ( |
| 654 | <div class="flex flex-col"> |
| 655 | <h2 class="p-2 text-xl font-bold h-fit">Select your screen</h2> |
nothing calls this directly
no test coverage detected