"use client";

import { FC, PropsWithChildren, use, useEffect } from "react";
import { DevToolboxContext } from "./context";

export const DevTool: FC<PropsWithChildren<{ id: string }>> = (
  { children, id },
) => {
  const { addTool, removeTool } = use(DevToolboxContext);
  useEffect(() => {
    addTool(id, children);
    (() => removeTool(id));
  }, [addTool, children, id, removeTool]);

  return <></>;
};
