// axi0 Motion 0.2.0: Notify toggle. A pill toggle: pressing it rings the bell, crossfades the label and floods the pill with color.
// Generated from src/notify-toggle/meta.json by motion-pack: a thin wrapper. The loader (motion.js) must be on the page once;
// it starts the effect on the element this renders. Options left out keep the effect's own defaults.
import { createElement } from "react";
import type { HTMLAttributes, ReactNode } from "react";

export interface NotifyToggleProps extends HTMLAttributes<HTMLElement> {
  /** the label while it is on (default "Notifying") */
  on?: string;
  /** The element to render (default "div") */
  as?: string;
  children?: ReactNode;
}

const s = (v: unknown) => (v === undefined ? undefined : String(v));

export function NotifyToggle({ as = "div", on, ...rest }: NotifyToggleProps) {
  return createElement(as, { ...rest, "data-motion": "notify-toggle", "data-motion-on": s(on) });
}

export default NotifyToggle;
