import NewYorkCaption from "./captionHeaders/newYorkCaption.js";
import NewJerseyCaption from "./captionHeaders/newJerseyCaption.js";
import FloridaCaption from "./captionHeaders/floridaCaption.js";
import { docEditCopy } from "../../Constants/Copy/docEditCopy.js";

const headerPicker = (state, fetchedCase, onScrollClick) => {
  const displayCopy =
    state === "ny"
      ? docEditCopy.NewYork
      : state === "nj"
      ? docEditCopy.NewJersey
      : docEditCopy.NewYork;

  switch (state) {
    case "ny":
      return (
        <NewYorkCaption
          displayCopy={displayCopy}
          fetchedCase={fetchedCase}
          onScrollClick={onScrollClick}
        />
      );
    case "nj":
      return (
        <NewJerseyCaption
          displayCopy={displayCopy}
          fetchedCase={fetchedCase}
          onScrollClick={onScrollClick}
        />
      );
    case "fl":
      return (
        <FloridaCaption
          displayCopy={displayCopy}
          fetchedCase={fetchedCase}
          onScrollClick={onScrollClick}
        />
      );
    default:
      return (
        <NewYorkCaption
          displayCopy={displayCopy}
          fetchedCase={fetchedCase}
          onScrollClick={onScrollClick}
        />
      );
  }
};

export default headerPicker;
