···11+"use client";
22+33+import { useState } from "react";
44+import { Heading } from "@/components/heading";
55+import { Paragraph } from "@/components/paragraph";
66+import { MinusIcon, PlusIcon } from "lucide-react";
77+88+type FaqItem = {
99+ id: string;
1010+ question: string;
1111+ answer: string;
1212+};
1313+1414+const FAQ_ITEMS: FaqItem[] = [
1515+ {
1616+ id: "web3-vs-traditional",
1717+ question: "Why is your Web3 hosting better than traditional hosting?",
1818+ answer:
1919+ "Unlike traditional hosting, eny.space offers decentralized infrastructure designed for uptime, security, and scalability. Your projects are backed by blockchain-based guarantees, reducing single points of failure and giving you the resilience you need to grow.",
2020+ },
2121+ {
2222+ id: "choose-plan",
2323+ question: "How do I know which pricing plan is right for me?",
2424+ answer:
2525+ "Start with the plan that matches your expected storage and traffic. You can upgrade at any time without downtime, and our team can help you right-size based on your current and projected usage.",
2626+ },
2727+ {
2828+ id: "secure-platform",
2929+ question: "What makes your platform secure for hosting my Web3 project?",
3030+ answer:
3131+ "We combine audited smart contract infrastructure with strong network isolation, encryption in transit and at rest, and continuous monitoring. This layered approach helps protect your data and on-chain assets from common attack vectors.",
3232+ },
3333+ {
3434+ id: "switch-plans",
3535+ question: "Can I switch plans later if my needs change?",
3636+ answer:
3737+ "Yes. You can move between plans at any time. Billing is prorated, and your deployments stay online during the switch so you can scale up or down without interruptions.",
3838+ },
3939+ {
4040+ id: "time-to-deploy",
4141+ question: "How soon can I deploy my Web3 project on eny.space?",
4242+ answer:
4343+ "Most teams deploy in minutes. Connect your wallet or Git repository, choose a plan, and follow the guided setup. Our onboarding flow is optimized so you can go from zero to live as quickly as possible.",
4444+ },
4545+];
4646+4747+export function FAQSection() {
4848+ const [openId, setOpenId] = useState<string | null>(FAQ_ITEMS[0]?.id ?? null);
4949+5050+ return (
5151+ <section className="relative w-full bg-neutral-950 px-4 py-20 sm:px-6 sm:py-24">
5252+ <div className="mx-auto max-w-4xl text-center">
5353+ <Heading
5454+ as="h2"
5555+ className="text-2xl font-semibold tracking-tight text-white sm:text-3xl md:text-4xl"
5656+ >
5757+ Frequently Asked Questions
5858+ </Heading>
5959+ <Paragraph className="mt-4 text-sm text-white/70 sm:text-base">
6060+ All the details you need about the product and billing. If you can't
6161+ find what you're looking for, feel free to{" "}
6262+ <span className="font-semibold text-white">
6363+ reach out to our friendly team
6464+ </span>
6565+ .
6666+ </Paragraph>
6767+ </div>
6868+6969+ <div className="mx-auto mt-10 max-w-3xl space-y-3 sm:mt-12">
7070+ {FAQ_ITEMS.map((item) => {
7171+ const isOpen = openId === item.id;
7272+7373+ return (
7474+ <div
7575+ key={item.id}
7676+ className={[
7777+ "overflow-hidden rounded-2xl border border-white/10 bg-neutral-900/40 transition-colors",
7878+ isOpen ? "bg-neutral-900/80" : "hover:bg-neutral-900/60",
7979+ ].join(" ")}
8080+ >
8181+ <button
8282+ type="button"
8383+ onClick={() => setOpenId(isOpen ? null : item.id)}
8484+ className="flex w-full items-center justify-between gap-4 px-5 py-4 text-left"
8585+ aria-expanded={isOpen}
8686+ >
8787+ <span className="text-sm font-medium text-white sm:text-base">
8888+ {item.question}
8989+ </span>
9090+ <span className="flex size-7 items-center justify-center rounded-full bg-white/8 text-white">
9191+ {isOpen ? (
9292+ <MinusIcon className="size-4" aria-hidden />
9393+ ) : (
9494+ <PlusIcon className="size-4" aria-hidden />
9595+ )}
9696+ </span>
9797+ </button>
9898+9999+ {isOpen && (
100100+ <div className="border-t border-white/10 px-5 pb-5 pt-3 text-sm text-white/75">
101101+ {item.answer}
102102+ </div>
103103+ )}
104104+ </div>
105105+ );
106106+ })}
107107+ </div>
108108+ </section>
109109+ );
110110+}
+2
app/components/faq/index.ts
···11+export { FAQSection } from "./faq-section";
22+
+2
app/page.tsx
···33import { FeaturesSection } from "@/components/features";
44import { PricingSection } from "@/components/pricing";
55import { TestimonialsSection } from "@/components/testimonials";
66+import { FAQSection } from "@/components/faq";
6778export default function Page() {
89 return (
···1213 <FeaturesSection />
1314 <PricingSection />
1415 <TestimonialsSection />
1616+ <FAQSection />
1517 </>
1618 );
1719}