import { useEffect, useState } from "react";
import { Stack } from "tamagui";
import { rgbToRgba } from "./utils";
import { jsx, jsxs } from "react/jsx-runtime";
function RadiantCircle({ size = "m" }) {
  const multiple = size === "s" ? 0.5 : size === "m" ? 1 : 1.5, [scales, setScales] = useState([1, 1.2, 1.4]);
  return useEffect(() => {
    const interval = setInterval(() => {
      setScales(
        (prevScales) => prevScales.map((scale) => scale >= 1.5 ? 1 : scale + 0.1)
      );
    }, 200);
    return () => clearInterval(interval);
  }, []), /* @__PURE__ */ jsxs(
    Stack,
    {
      position: "relative",
      width: 10 * multiple,
      height: 10 * multiple,
      alignItems: "center",
      justifyContent: "center",
      scale: multiple,
      children: [
        /* @__PURE__ */ jsx(
          Stack,
          {
            position: "absolute",
            margin: "auto",
            width: 10,
            height: 10,
            borderRadius: 5,
            backgroundColor: rgbToRgba("$success", 0.8)
          }
        ),
        /* @__PURE__ */ jsx(
          Stack,
          {
            width: 15,
            height: 15,
            borderRadius: 7.5,
            backgroundColor: rgbToRgba("$success", 0.4),
            position: "absolute",
            margin: "auto",
            scale: scales[0],
            opacity: scales[0] > 1.2 ? 0.5 : 0,
            style: {
              transition: "transform 0.5s ease-in-out, opacity 0.5s ease-in-out"
            }
          }
        ),
        /* @__PURE__ */ jsx(
          Stack,
          {
            width: 20,
            height: 20,
            borderRadius: 10,
            backgroundColor: rgbToRgba("$success", 0.19),
            position: "absolute",
            margin: "auto",
            scale: scales[1],
            opacity: scales[1] > 1.3 ? 0.3 : 0,
            style: {
              transition: "transform 0.5s ease-in-out, opacity 0.5s ease-in-out"
            }
          }
        ),
        /* @__PURE__ */ jsx(
          Stack,
          {
            width: 25,
            height: 25,
            borderRadius: 12.5,
            backgroundColor: rgbToRgba("$success", 0.2),
            position: "absolute",
            margin: "auto",
            scale: scales[2],
            opacity: scales[2] > 1.4 ? 0.2 : 0,
            style: {
              transition: "transform 0.5s ease-in-out, opacity 0.5s ease-in-out"
            }
          }
        )
      ]
    }
  );
}
export {
  RadiantCircle
};
//# sourceMappingURL=RadiantCircle.js.map
