"use client";
import { jsx, jsxs } from "react/jsx-runtime";
import { useMemo } from "react";
function Switch({ checked, onClick, text, id }) {
    const buttonId = useMemo(()=>`id_ ${Math.floor(10000 * Math.random())}`, []);
    return /*#__PURE__*/ jsxs("div", {
        className: "switch",
        id: id,
        children: [
            /*#__PURE__*/ jsx("label", {
                htmlFor: buttonId,
                children: text
            }),
            /*#__PURE__*/ jsx("button", {
                type: "button",
                role: "switch",
                "aria-checked": checked,
                id: buttonId,
                onClick: onClick,
                children: /*#__PURE__*/ jsx("span", {})
            })
        ]
    });
}
export default Switch;
