Skip to content

#1 PDF Application on GitHub that lets you edit PDFs on any device anywhere

872 B
Raw Blame
import type { ReactNode } from "react";
import { usePoliciesEnabled } from "@editor/components/policies/usePoliciesEnabled";
import { ClassificationDemoWorkbenchView } from "@editor/components/onboarding/classificationDemo/ClassificationDemoWorkbenchView";
import {
  endClassificationDemo,
  useClassificationDemoSession,
} from "@editor/components/onboarding/classificationDemo/classificationDemoSession";

/** Onboarding's Downloads sweep owns the canvas from acceptance until dismissal.
 *  See the core stub for why this is a takeover, not a registered custom view. */
export function useWorkbenchTakeover(): ReactNode | null {
  const run = useClassificationDemoSession();
  const enabled = usePoliciesEnabled();
  if (!run || !enabled) return null;
  return (
    <ClassificationDemoWorkbenchView
      data={run}
      onDone={endClassificationDemo}
    />
  );
}