File size: 1,302 Bytes
6ce4ca6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3cdf7b9
 
 
 
 
6ce4ca6
 
 
 
3cdf7b9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<script lang="ts">
	import { T } from "@threlte/core";
	import { Billboard, interactivity } from "@threlte/extras";
	import { Root, Container } from "threlte-uikit";
	import ComputeConnectionFlowBoxUIKit from "./ComputeConnectionFlowBoxUIKit.svelte";
	import type { RemoteCompute } from "$lib/elements/compute//RemoteCompute.svelte";

	interface Props {
		compute: RemoteCompute;
		visible?: boolean;
		onVideoInputBoxClick: (compute: RemoteCompute) => void;
		onRobotInputBoxClick: (compute: RemoteCompute) => void;
		onRobotOutputBoxClick: (compute: RemoteCompute) => void;
	}

	let {
		compute,
		visible = true,
		onVideoInputBoxClick,
		onRobotInputBoxClick,
		onRobotOutputBoxClick
	}: Props = $props();

	interactivity();
</script>

<T.Group
	onclick={(e) => e.stopPropagation()}
	position.z={0.4}
	padding={10}
	rotation={[-Math.PI / 2, 0, 0]}
	scale={[0.1, 0.1, 0.1]}
	pointerEvents="listener"
	{visible}
>
	<Billboard>
		<Root name={`compute-status-billboard-${compute.id}`}>
			<Container
				width="100%"
				height="100%"
				alignItems="center"
				justifyContent="center"
				padding={20}
			>
				<ComputeConnectionFlowBoxUIKit
					{compute}
					{onVideoInputBoxClick}
					{onRobotInputBoxClick}
					{onRobotOutputBoxClick}
				/>
			</Container>
		</Root>
	</Billboard>
</T.Group>