import { useSharedState } from "../../../store/useSharedState";
import GeneratePreviewImage from "./GeneratePreviewImage";
import GeneratePreviewPoints from "./GeneratePreviewPoints";

function GeneratePreview({ preview = true }) {
  const previewMode = useSharedState((state) => state.previewMode); //
  const urls = useSharedState((state) => state.urls);

  if (preview && urls[previewMode] === "") return null;

  return (
    <div className="idm_picture__module">
      {<GeneratePreviewImage preview={preview} urls={urls} />}
      {<GeneratePreviewPoints preview={preview} />}
    </div>
  );
}

export default GeneratePreview;
