"use client";

import { FlexLayout } from "./flexlayout";
import { useProblemFlexLayoutStore } from "@/stores/flexlayout";

interface ProblemFlexLayoutProps {
  components: Record<string, React.ReactNode>;
}

export const ProblemFlexLayout = ({ components }: ProblemFlexLayoutProps) => {
  const { hasHydrated, model, jsonModel, setModel, setJsonModel } =
    useProblemFlexLayoutStore();

  return (
    <FlexLayout
      components={components}
      hasHydrated={hasHydrated}
      model={model}
      jsonModel={jsonModel}
      setModel={setModel}
      setJsonModel={setJsonModel}
    />
  );
};
