import { siteConfig } from "./siteConfig";

export const commonSchemas = {
  organization: {
    "@context": "https://schema.org",
    "@type": "Organization",
    name: "The Book Quill",
    alternateName: "TheBookQuill",
    url: siteConfig.siteUrl,
    logo: `${siteConfig.siteUrl}/assets/images/banner-logo.webp`,
    description:
      "The Book Quill provides professional book writing, ghostwriting, editing, proofreading, publishing, cover design, author branding, book marketing, and eBook services across the USA.",
    email: "info@thebookquill.com",
    telephone: "+1 (323) 503-1458",
    address: {
      "@type": "PostalAddress",
      streetAddress: "594 Broadway 9th Floor Suite 901",
      addressLocality: "New York",
      addressRegion: "NY",
      postalCode: "10012",
      addressCountry: "US",
    },
    foundingDate: "2020",
    founder: {
      "@type": "Person",
      name: "The Book Quill",
    },
    sameAs: [
      "https://www.facebook.com/bookquillofficial",
      "https://www.trustpilot.com/review/thebookquill.com",
      "https://www.goodfirms.co/company/the-book-quill",
      "https://clutch.co/profile/book-quill",
      "https://www.provenexpert.com/the-book-quill",
      "https://www.pinterest.com/thebookquill/",
      "https://www.bark.com/en/us/company/the-book-quill/LeBboK/",
      "https://x.com/the_book_quill",
      "https://www.instagram.com/thebookquill/",
      "https://www.linkedin.com/company/thebookquill",
    ],
    contactPoint: {
      "@type": "ContactPoint",
      contactType: "Customer Support",
      email: "info@thebookquill.com",
      availableLanguage: ["English"],
    },
  },

  website: {
    "@context": "https://schema.org",
    "@type": "WebSite",
    name: "The Book Quill",
    url: siteConfig.siteUrl,
    potentialAction: {
      "@type": "SearchAction",
      target: `${siteConfig.siteUrl}/?s={search_term_string}`,
      "query-input": "required name=search_term_string",
    },
  },
};

export const pageSchemaData = {
  home: {
    service: {
      name: "Professional Book Writing & Publishing Services",
      serviceType:
        "Book Writing, Ghostwriting, Book Editing, Book Publishing, eBook Writing",
      description:
        "The Book Quill offers expert book writing, ghostwriting, editing, proofreading, cover design, publishing, and marketing services for authors across the USA.",
      areaServed: "USA",
      url: `${siteConfig.siteUrl}/`,
    },
    faq: [
      {
        question: "Do you offer ghostwriting services?",
        answer:
          "Yes, The Book Quill provides confidential ghostwriting services for all genres including fiction, nonfiction, memoirs, business books, and children’s books.",
      },
      {
        question: "Can you publish my book on Amazon KDP?",
        answer:
          "Yes, we offer complete Amazon KDP publishing services including formatting, cover design, metadata, ISBN setup, categories, and launch support.",
      },
      {
        question: "What services do you offer?",
        answer:
          "We offer book writing, ghostwriting, editing, proofreading, formatting, book cover design, publishing, book marketing, branding, audiobook production, and author website design.",
      },
    ],
  },

  bookWriting: {
    service: {
      name: "Book Writing Services USA",
      serviceType: "Book Writing Services",
      description:
        "Professional book writing and ghostwriting services in the USA for fiction, nonfiction, memoirs, business books, and children’s books.",
      areaServed: "USA",
      url: `${siteConfig.siteUrl}/book-writing`,
    },
    faq: [
      {
        question: "What types of books do you write?",
        answer:
          "We write fiction, nonfiction, memoirs, business books, self-help books, and children’s books tailored to your goals and target audience.",
      },
      {
        question: "Do you provide confidential ghostwriting services?",
        answer:
          "Yes, our ghostwriting services are fully confidential and customized to match your voice, idea, and vision.",
      },
      {
        question: "Can you help from idea to final manuscript?",
        answer:
          "Yes, we can assist with concept development, outlining, writing, revisions, and preparing the manuscript for editing or publishing.",
      },
    ],
  },

  bookPublishing: {
    service: {
      name: "Book Publishing Services USA",
      serviceType: "Book Publishing Services",
      description:
        "Professional publishing services including formatting, ISBN support, layout, printing, and distribution guidance for authors in the USA.",
      areaServed: "USA",
      url: `${siteConfig.siteUrl}/book-publishing`,
    },
    faq: [
      {
        question: "Do you help with self-publishing?",
        answer:
          "Yes, we help authors with self-publishing support including formatting, setup, publishing guidance, and distribution preparation.",
      },
      {
        question: "Can you format my book for publishing platforms?",
        answer:
          "Yes, we format books for print and digital platforms to ensure professional layout and compatibility.",
      },
      {
        question: "Do you provide ISBN and publishing guidance?",
        answer:
          "Yes, we assist with ISBN guidance, publishing steps, and overall launch preparation for authors.",
      },
    ],
  },

  bookEditing: {
    service: {
      name: "Book Editing & Proofreading Services USA",
      serviceType: "Book Editing and Proofreading Services",
      description:
        "Expert editing and proofreading services in the USA to improve grammar, clarity, structure, readability, and manuscript quality.",
      areaServed: "USA",
      url: `${siteConfig.siteUrl}/book-editing`,
    },
    faq: [
      {
        question: "What is included in your editing service?",
        answer:
          "Our editing service can include grammar correction, sentence refinement, clarity improvement, structure review, and proofreading depending on your manuscript needs.",
      },
      {
        question: "Do you proofread completed manuscripts?",
        answer:
          "Yes, we provide professional proofreading for completed manuscripts to catch grammar, spelling, punctuation, and formatting issues.",
      },
      {
        question: "Can editing improve my manuscript before publishing?",
        answer:
          "Yes, professional editing improves readability, consistency, and overall quality, making your manuscript stronger before publishing.",
      },
    ],
  },

  bookCoverDesign: {
    service: {
      name: "Book Cover Design Services USA",
      serviceType: "Book Cover Design Services",
      description:
        "Custom book cover design services in the USA for Amazon KDP, eBooks, paperback, and hardcover books.",
      areaServed: "USA",
      url: `${siteConfig.siteUrl}/book-cover-design`,
    },
    faq: [
      {
        question: "Do you design covers for Amazon KDP books?",
        answer:
          "Yes, we design professional book covers for Amazon KDP, print books, eBooks, paperback, and hardcover formats.",
      },
      {
        question: "Can I request a custom genre-based book cover?",
        answer:
          "Yes, we create custom book covers based on your genre, audience, branding, and publishing platform requirements.",
      },
      {
        question: "Do you provide both front and full wrap covers?",
        answer:
          "Yes, depending on your publishing needs, we can provide front cover designs as well as full wrap print cover layouts.",
      },
    ],
  },

  amazonPublishing: {
    service: {
      name: "Amazon Publishing Services USA",
      serviceType: "Amazon KDP Publishing Services",
      description:
        "Professional Amazon KDP publishing support including formatting, metadata, category setup, and launch assistance.",
      areaServed: "USA",
      url: `${siteConfig.siteUrl}/amazon-publishing`,
    },
    faq: [
      {
        question: "Do you publish books on Amazon KDP?",
        answer:
          "Yes, we help authors publish books on Amazon KDP with formatting, cover setup, metadata, and publishing guidance.",
      },
      {
        question: "Can you help with KDP categories and keywords?",
        answer:
          "Yes, we assist with book metadata, keywords, and category selection to improve book discoverability on Amazon.",
      },
      {
        question: "Do you support both print and Kindle publishing?",
        answer:
          "Yes, we support both Kindle eBook publishing and print book setup for Amazon KDP.",
      },
    ],
  },

  ghostwritingServices: {
    service: {
      name: "Ghostwriting Services USA",
      serviceType: "Ghostwriting Services",
      description:
        "Professional ghostwriting services in the USA for books, memoirs, novels, business content, and children’s stories.",
      areaServed: "USA",
      url: `${siteConfig.siteUrl}/ghostwriting-services`,
    },
    faq: [
      {
        question: "Do you offer confidential ghostwriting?",
        answer:
          "Yes, our ghostwriting services are confidential and tailored to your voice, vision, and publishing goals.",
      },
      {
        question: "Can you ghostwrite memoirs and novels?",
        answer:
          "Yes, we ghostwrite memoirs, novels, nonfiction books, business books, and other custom projects.",
      },
      {
        question: "How do you match the author's voice?",
        answer:
          "We gather your ideas, style preferences, and direction carefully so the final manuscript reflects your intended tone and voice.",
      },
    ],
  },
};

export function getServiceSchema(key) {
  const page = pageSchemaData[key];

  if (!page || !page.service) return null;

  return {
    "@context": "https://schema.org",
    "@type": "Service",
    name: page.service.name,
    provider: {
      "@type": "Organization",
      name: "The Book Quill",
      url: siteConfig.siteUrl,
    },
    serviceType: page.service.serviceType,
    areaServed: page.service.areaServed || "USA",
    description: page.service.description,
    url: page.service.url,
  };
}

export function getFaqSchema(key) {
  const page = pageSchemaData[key];

  if (!page || !page.faq || !page.faq.length) return null;

  return {
    "@context": "https://schema.org",
    "@type": "FAQPage",
    mainEntity: page.faq.map((item) => ({
      "@type": "Question",
      name: item.question,
      acceptedAnswer: {
        "@type": "Answer",
        text: item.answer,
      },
    })),
  };
}
