Skip to content

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

962 B
Raw Blame
import { Icon } from "@editor/ui/Icon";
import { Button } from "@editor/ui";
import "@processor/components/pipelines/graph/GraphPlaceholderNode.css";

export interface GraphPlaceholderNodeProps {
  label: string;
  onAdd: () => void;
}

/**
 * The stand-in for a row the pipeline has not filled yet - the first step, or either end of the
 * chain on a new pipeline. It sits in the row that thing will occupy, so the chain reads as
 * input -> something -> output straight away, and it is the thing you click to fill it: a full-width
 * target, rather than a caption pointing at a small plus on a wire.
 */
export function GraphPlaceholderNode({
  label,
  onAdd,
}: GraphPlaceholderNodeProps) {
  return (
    <Button
      variant="quiet"
      className="portal-graph-placeholder"
      onClick={onAdd}
      leftSection={<Icon name="plus" size={"1.125rem"} />}
    >
      <span className="portal-graph-placeholder__title">{label}</span>
    </Button>
  );
}