import { jsx } from "react/jsx-runtime";
import { memo, useMemo } from "react";
import { StateBarTv } from "./tv.js";
import { usePromptInputContext } from "../../context/prompt-input-context.js";
import { motion } from "../../../../_vendor/framer-motion/dist-es-render-components-motion-proxy.js";
import { usePlanUpdates } from "../prompt-plan-todo-list/hooks/use-plan-updates.js";
const PromptStateBar = memo(function PromptStateBar2(props) {
  const { children } = props;
  const { hasPendingMessages } = usePromptInputContext();
  const { currentPlan } = usePlanUpdates();
  const isOpen = useMemo(() => {
    return hasPendingMessages || currentPlan && currentPlan.length > 0;
  }, [hasPendingMessages, currentPlan]);
  const tv = StateBarTv();
  const stateVariants = {
    initial: { y: 40, opacity: 0 },
    animate: {
      y: isOpen ? 0 : 40,
      opacity: isOpen ? 1 : 0
    },
    exit: { y: 40, opacity: 0 }
  };
  if (!isOpen) return null;
  return /* @__PURE__ */ jsx(
    motion.div,
    {
      variants: stateVariants,
      initial: "initial",
      animate: "animate",
      exit: "exit",
      transition: { duration: 0.2, ease: "easeInOut", delay: 0.2 },
      className: tv.root(),
      children
    }
  );
});
export {
  PromptStateBar
};
//# sourceMappingURL=prompt-state-bar.js.map
