import { useEffect, useState } from 'react'; import { Link } from 'react-router-dom'; import { api, asList } from '../lib/api'; import type { Product } from '../lib/types'; import ProductCard from '../components/ProductCard'; import { EmptyState } from '../components/EmptyState'; import { Spinner } from '../components/Spinner'; import { IconArrowRight, IconBoxes, IconShield, IconSparkles, IconTruck, IconZap, } from '../components/Icons'; const pillars = [ { icon: IconZap, title: 'Automated sourcing', body: 'Suppliers are vetted, scored and routed automatically.' }, { icon: IconSparkles, title: 'Dynamic pricing', body: 'Every listing is priced against the market, continuously.' }, { icon: IconShield, title: 'Quality checked', body: 'Products pass a lifecycle gate before they ever go live.' }, { icon: IconTruck, title: 'Tracked fulfillment', body: 'Live tracking on every order, from supplier to doorstep.' }, ]; const steps = [ { n: '01', title: 'Browse & order', body: 'Shop curated products at market-fair prices.' }, { n: '02', title: 'Automated fulfillment', body: 'Polaris routes your order to the best-scoring supplier.' }, { n: '03', title: 'Track to your door', body: 'Follow the shipment with live status and tracking.' }, ]; export default function Home() { const [featured, setFeatured] = useState(null); useEffect(() => { api .get('/products?status=published&limit=4') .then((res) => setFeatured(asList(res))) .catch(() => setFeatured([])); }, []); return (
{/* ── Hero ── */}
The North Star of automated e-commerce

Curated products.
Automated commerce.

Polaris sources, prices and fulfills products from vetted suppliers — so every order ships fast, at a fair price, with tracking you can follow.

Shop the collection Track an order
{/* ── Pillars ── */}
{pillars.map((p) => (

{p.title}

{p.body}

))}
{/* ── Featured ── */}

Featured now

Fresh from the pipeline, live today.

View all
{featured === null ? (
) : featured.length === 0 ? ( } title="Nothing published yet" hint="The product pipeline is warming up — check back soon." /> ) : (
{featured.map((p) => ( ))}
)}
{/* ── How it works ── */}

How Polaris works

{steps.map((s) => (
{s.n}

{s.title}

{s.body}

))}
); }