import { Fragment } from "react/jsx-runtime"; import { lootboxes } from "../../../shared/lootboxes"; import { Button } from "../../components/Button"; import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger, } from "../../components/Dialog"; import GemsIcon from "../../components/GemIcon"; import { themes } from "../../themes"; import { useWSMutation, useWSQuery } from "../../hooks"; import { Rarity } from "../../components/Rarity"; import { lootboxResultAtom } from "../../atoms"; import { useAtom } from "jotai"; import { useEffect } from "react"; import { initParticlesEngine, Particles as ParticlesComponent } from "@tsparticles/react"; import { motion } from "motion/react"; import BounceImg from "../../components/BounceImg"; import RegisterButton from "../../components/Auth/RegisterButton"; const Store = () => { const openLootbox = useWSMutation("user.openLootbox"); const [lootboxResult, setLootboxResult] = useAtom(lootboxResultAtom); const currentLootbox = lootboxes.find((l) => l.id === lootboxResult?.lootbox); const { data: username } = useWSQuery("user.getSelf", null); const { refetch } = useWSQuery("user.getOwnGems", null); // this should be run only once per application lifetime useEffect(() => { const cb = async () => { const { loadSlim } = await import("@tsparticles/slim"); const { loadSeaAnemonePreset } = await import("@tsparticles/preset-sea-anemone"); initParticlesEngine(async (engine) => { // you can initiate the tsParticles instance (engine) here, adding custom shapes or presets // this loads the tsparticles package bundle, it's the easiest method for getting everything ready // starting from v2 you can add only the features you need reducing the bundle size //await loadAll(engine); //await loadFull(engine); await loadSlim(engine); await loadSeaAnemonePreset(engine); //await loadBasic(engine); }); }; cb(); }, []); return ( <>