export const docEditCopy = {
  NewYork: {
    prelimaryStatement: function (
      documentType,
      respondent,
      servingParty,
      fetchedCase
    ) {
      const position = fetchedCase ? fetchedCase.clientPosition : <></>;
      const docCopy =
        documentType && documentType === "interrogatories"
          ? "Interrogatories"
          : documentType && documentType === "admissions"
          ? "Request for Admissions"
          : documentType && documentType === "production"
          ? "Request for Production"
          : documentType && documentType.includes("combined")
          ? "Interrogatories and Request for Production"
          : null;

      const copyString = `COMES NOW, Respondent(s), ${respondent}, through counsel, in response to the ${docCopy}
        served by ${servingParty}, and states as follows:`;

      return (
        <div className="prelim-statement-container">
          <p className="docedit-prelim-text">{copyString}</p>
        </div>
      );
    },
    caseNumber: "Index No.",
    versusText: "- against -",
  },
  NewJersey: {
    prelimaryStatement: function (documentType, respondent, servingParty) {
      const docCopy =
        documentType && documentType === "interrogatories"
          ? "Interrogatories"
          : documentType && documentType === "admissions"
          ? "Request for Admissions"
          : documentType && documentType === "production"
          ? "Request for Production"
          : documentType && documentType.includes("combined")
          ? "Interrogatories and Request for Production"
          : null;

      const copyString = `COMES NOW, Respondent(s), ${respondent}, through counsel, in response to the ${docCopy}
        served by ${servingParty}, and states as follows:`;

      return (
        <div className="prelim-statement-container">
          <p>{copyString}</p>
        </div>
      );
    },
    caseNumber: "Docket No.",
    versusText: "vs.",
  },
  Michigan: {
    prelimaryStatement: function (documentType, respondent, servingParty) {
      const docCopy =
        documentType && documentType === "interrogatories"
          ? "Interrogatories"
          : documentType && documentType === "admissions"
          ? "Request for Admissions"
          : documentType && documentType === "production"
          ? "Request for Production"
          : documentType && documentType.includes("combined")
          ? "Interrogatories and Request for Production"
          : null;

      const copyString = `COMES NOW, Respondent(s), ${respondent}, through counsel, in response to the ${docCopy}
        served by ${servingParty}, and states as follows:`;

      return (
        <div className="prelim-statement-container">
          <p>{copyString}</p>
        </div>
      );
    },
    caseNumber: "Case No.",
    versusText: "v.",
  },
};

export const outgoingComesNow = (state, fetchedCase) => {
  let copyString;

  const servingParty =
    fetchedCase?.clientPosition === "Plaintiff"
      ? fetchedCase?.plaintiffParties
      : fetchedCase?.defendantParties;
  const respondingParty =
    servingParty === fetchedCase?.plaintiffParties
      ? fetchedCase?.defendantParties
      : fetchedCase?.plaintiffParties;

  if (state === "ny") {
    copyString = `COMES NOW, ${fetchedCase?.clientPosition}, ${servingParty}, through counsel, and hereby propounds these Interrogatories and Requests for Production on ${respondingParty}, to be answered under oath, in writing, in accordance with NY CPLR 3120 - 3130.`;
  } else if (state === "fl") {
    copyString = `COMES NOW,  ${fetchedCase?.clientPosition}, ${servingParty}, through counsel, and hereby propounds these Interrogatories and Requests for Production on ${respondingParty}, to be answered to be answered under oath, in writing, in accordance with Rule 1.340, Florida Rules of Civil Procedure.`;
  } else if (state === "nj") {
    copyString =
      `Comes now ${fetchedCase?.clientPosition}, ${servingParty}, through counsel, and hereby propounds these Interrogatories and Requests for Production on ${respondingParty}, to be answered to be answered under oath, in writing, in accordance with NJ R. 4:17-1 - 4:18-1,` +
      <div className="jersey-itals">et. seq.</div> +
      `All questions must be answered unless the court otherwise orders or unless a claim of privilege or protective order is made in accordance with R. 4:17-1(b)(3).`;
  }

  return <div className="req-edit-comesnow">{copyString}</div>;
};
