"use client" import type React from "react" import { Link } from "react-router-dom" import { Search, Mail, Phone, MapPin, Facebook, Twitter, Instagram, Youtube, Clock, Users, Database, Award, } from "lucide-react" import { Button } from "@/components/ui/button" import { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious } from "@/components/ui/carousel" import { Card, CardContent } from "@/components/ui/card" import SearchForm from "./SearchForm" import { useEffect, useState } from "react" import { useNavigate } from "react-router-dom" import ApiService from "@/services/apiService" import type { Person } from "@/types/api" export default function Home() { const [currentSlide, setCurrentSlide] = useState(0) const navigate = useNavigate() const [total, setTotal] = useState(0) const [migrants, setMigrants] = useState([]) const API_BASE_URL = "http://localhost:8000" useEffect(() => { async function fetchData() { const response = await ApiService.getMigrants(1, 10) setMigrants(response.data || []) setTotal(response.total || 0) } fetchData() }, []) const backgroundImages = [ { src: `${import.meta.env.BASE_URL}slide1.avif`, alt: "Italian countryside landscape", }, { src: `${import.meta.env.BASE_URL}slide2.avif`, alt: "Vintage Italian architecture", }, { src: `${import.meta.env.BASE_URL}slide3.avif`, alt: "Italian coastal town", }, { src: `${import.meta.env.BASE_URL}slide4.avif`, alt: "Italian countryside with vineyards", }, ] const galleryImages = [ { src: "https://images.unsplash.com/photo-1523906834658-6e24ef2386f9?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=800&q=80", alt: "Italian countryside village", }, { src: "https://images.unsplash.com/photo-1515542622106-78bda8ba0e5b?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=800&q=80", alt: "Italian landscape", }, { src: "https://images.unsplash.com/photo-1552832230-c0197dd311b5?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=800&q=80", alt: "Italian vineyards", }, { src: "https://images.unsplash.com/photo-1516483638261-f4dbaf036963?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=800&q=80", alt: "Italian coastal town", }, { src: "https://images.unsplash.com/photo-1581833971358-2c8b550f87b3?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=800&q=80", alt: "Italian traditional building", }, ] useEffect(() => { const timer = setInterval(() => { setCurrentSlide((prev) => (prev + 1) % backgroundImages.length) }, 5000) return () => clearInterval(timer) }, [backgroundImages.length]) // Smooth scroll to contact section const scrollToContact = (e: React.MouseEvent) => { e.preventDefault() const contactSection = document.getElementById("contact") if (contactSection) { contactSection.scrollIntoView({ behavior: "smooth", block: "start", }) } } return (
Italian Migrants NT
{/* Hero Section with Background Carousel and Search */}
{/* Background Carousel */}
{backgroundImages.map((image, index) => (
{image.alt}
))}
{/* Centered Content with Search */}

Find Your Italian Heritage

Search our comprehensive database of Italian migrants to the Northern Territory. Discover family histories, personal stories, and cultural contributions spanning over a century.

{/* Main Search Form */}

Search Migrant Database

{/* Quick Stats */}
{total.toLocaleString()}
Migrant Records
1880-1980
Years Covered
156
Italian Regions
{/* Carousel Indicators */}
{backgroundImages.map((_, index) => (
{/* Quick Search Tips */}

Search Tips

Get the most out of your search with these helpful tips

Name Variations

Try different spellings and shortened versions of names as they may have been anglicized upon arrival.

πŸ“…

Date Ranges

Use broader date ranges as exact arrival dates may not always be recorded accurately.

πŸ—ΊοΈ

Regional Search

Search by Italian region or province if you know your family's origin to narrow results.

Featured Stories

Discover some of the remarkable personal journeys found in our database. Each story represents courage, determination, and the pursuit of a better life.

{migrants.map((person) => { // Find the profile photo const profilePhoto = person.photos?.find((photo) => photo.is_profile_photo) return (
{`Portrait

{person.full_name || person.surname || "Unnamed"}

Arrived{" "} {person.migration?.date_of_arrival_nt ? new Date(person.migration.date_of_arrival_nt).getFullYear() : "Unknown"}

{person.additional_notes || "No story available."}

) })}

Preserving Our Heritage

This digital archive aims to preserve and celebrate the contributions of Italian migrants to the Northern Territory. By documenting their stories, photographs, and historical records, we ensure that their legacy continues for generations to come.

{galleryImages.map((image, index) => (
{image.alt}
))}
{/* Enhanced Footer with Contact Information */}
) }