"use client"; import { useState } from "react"; import { useTranslations } from "next-intl"; import { toast } from "sonner"; import { CreatePageLayout } from "@/components/layout/create-layout"; import { Link } from "@/i18n/routing"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { Input } from "@/components/ui/input"; import { Badge } from "@/components/ui/badge"; import { TablePanel } from "@/components/table/table-panel"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from "@/components/ui/table"; import { ArrowLeft, Download, Upload } from "lucide-react"; type Step = "upload" | "preview"; const PREVIEW_ROWS = [ { employeeId: "YT-1201", name: "Tigist Alemu", department: "Engineering", package: "Gold Corporate" }, { employeeId: "YT-1202", name: "Biniam Tesfaye", department: "Sales", package: "Silver Standard" }, { employeeId: "YT-1203", name: "Hanna Bekele", department: "Operations", package: "Bronze Essentials" }, ]; export default function MembersImportPage() { const t = useTranslations(); const [step, setStep] = useState("upload"); const [fileName, setFileName] = useState(null); function handleFileChange(e: React.ChangeEvent) { const file = e.target.files?.[0]; if (file) { setFileName(file.name); setStep("preview"); } } function handleImport() { toast.success(t("common.pending")); } return ( }> {t("common.back")} } >
1. {t("common.upload")} 2. {t("common.preview")}
{step === "upload" && ( {t("common.upload")} Upload an Excel file or download the template first.
)} {step === "preview" && fileName && (

{t("common.preview")}

{fileName} — 3 rows ready to import

{t("members.employeeId")} Name {t("members.department")} {t("members.package")} {PREVIEW_ROWS.map((row) => ( {row.employeeId} {row.name} {row.department} {row.package} ))}
)}
); }