import React, { Children, useEffect } from "react";
import { useStore } from "../stores/global-stores";

export default function ContentViewLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  const [setShowOmsInputBar] = useStore((states) => [
    states.setShowOmsInputBar,
  ]);
  useEffect(() => {
    setShowOmsInputBar(false);
    return () => {
      setShowOmsInputBar(true);
    };
  }, []);
  return (
    <div
      className="oms-scrollbar"
      style={{
        display: "flex",
        flexWrap: "nowrap",
      }}
    >
      <div
        style={{
          height: "400px",
          overflowY: "auto",
          flex: 1,
        }}
      >
        {children}
      </div>
    </div>
  );
}
