import Hero from "@/components/software/hero/Hero";
import Services from "@/components/software/Services";
import TechStack from "@/components/software/TechStack";
import Process from "@/components/software/Process";
import Projects from "@/components/software/Projects";
import { BACKEND_URL_LOCAL } from "@/utilities/constants/urls.constant";
import { Portfolio } from "@/utilities/types/portfolio.type";

export default async function SoftwarePage({ params }: { params: Promise<{ locale: string }> }) {
  const { locale } = await params;

  const latestPortfolios: Portfolio[] = await fetch(`${BACKEND_URL_LOCAL}/portfolios/category/software/${locale}`)
    .then((res) => res.json())
    .then((res) => res.data);

  return (
    <main className="bg-[linear-gradient(rgba(255,255,255,0.02)_1px,transparent_1px),linear-gradient(90deg,rgba(255,255,255,0.02)_1px,transparent_1px)] bg-[size:40px_40px]">
      <Hero />
      <Services />
      <TechStack />
      <Process />
      <Projects data={latestPortfolios} />
    </main>
  );
}
