MCPcopy Create free account
hub / github.com/Recordscript/recordscript / ScreenSelector

Function ScreenSelector

src/App.tsx:641–677  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

639 }
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>
656 <hr class="" />
657 <div class="p-2 flex flex-wrap justify-center content-start gap-2">
658 <Suspense>
659 <For each={screens()!}>
660 {(device, idx) => (
661 <Screen name={device.name} display_name={`Screen ${idx() + 1}`} selected={screen() ? screen() === device.name : device.is_selected} />
662 )}
663 </For>
664 </Suspense>
665 </div>
666 <button
667 onClick={() => {
668 set_popup(null);
669 recording.start();
670 }}
671 class="w-full h-full max-h-[3rem] border border-x-transparent font-bold p-2 cursor-pointer"
672 >
673 Start Recording
674 </button>
675 </div>
676 )
677 }
678
679 function ListModelSection() {
680 return (

Callers 1

RecorderFunction · 0.85

Calls 1

startMethod · 0.45

Tested by

no test coverage detected