2024-07-10 20:47:02 -05:00
|
|
|
import { Flex, FlexProps, Progress } from '@radix-ui/themes';
|
2024-07-10 18:57:27 -05:00
|
|
|
import { useProgress } from '@react-three/drei';
|
2024-07-10 13:31:21 -05:00
|
|
|
import { tankIcon } from '../../../../../../core/blitzkit/tankIcon';
|
|
|
|
|
|
2024-07-10 20:47:02 -05:00
|
|
|
type TankSandboxLoaderProps = Omit<FlexProps, 'id'> & {
|
|
|
|
|
id: number;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export function TankSandboxLoader({ id, ...props }: TankSandboxLoaderProps) {
|
2024-07-10 18:57:27 -05:00
|
|
|
const data = useProgress();
|
|
|
|
|
|
2024-07-10 13:31:21 -05:00
|
|
|
return (
|
2024-07-10 20:47:02 -05:00
|
|
|
<Flex width="100%" height="100%" align="center" justify="center" {...props}>
|
|
|
|
|
<img src={tankIcon(id)} style={{ height: '60%', filter: 'blur(4px)' }} />
|
2024-07-10 18:57:27 -05:00
|
|
|
<Progress
|
|
|
|
|
size="3"
|
|
|
|
|
value={data.progress}
|
|
|
|
|
style={{ position: 'absolute', width: 128 }}
|
|
|
|
|
/>
|
2024-07-10 13:31:21 -05:00
|
|
|
</Flex>
|
|
|
|
|
);
|
|
|
|
|
}
|