// app/buying-guide/finder/page.tsx "use client"; import { useMemo, useState } from "react"; import { useForm } from "react-hook-form"; import type { Answers, LaserType } from "@/lib/laser-finder"; import { scoreAnswers, LASER_LABEL, TYPE_INFO } from "@/lib/laser-finder"; import Link from "next/link"; export default function LaserFinderPage() { const [result, setResult] = useState<{ top: LaserType[]; score: Record; why: Record; } | null>(null); const { register, handleSubmit, reset, watch } = useForm({ defaultValues: { materials: [], operations: [], part_size: "medium", detail: "medium", throughput: "medium", budget: "mid", }, }); const onSubmit = (vals: Answers) => { const { ranked, score, why } = scoreAnswers(vals); setResult({ top: ranked.slice(0, 2), score, why }); // (Optional) later: POST vals to Directus for analytics }; const selectedMaterials = watch("materials"); const selectedOps = watch("operations"); return (

Laser Type Finder

Answer a few questions and we’ll suggest the best laser types for your work with clear use-cases, materials, and cautions. No product pitches—just guidance.

{!result && (
{/* Materials */}
Materials (select all that apply)
{[ ["metals_bare", "Bare metals"], ["metals_coated", "Coated/painted metals"], ["plastics", "Plastics"], ["wood_paper_leather", "Wood, paper, leather"], ["glass_ceramic", "Glass / ceramic"], ["stone", "Stone"], ["textiles", "Textiles"], ].map(([val, label]) => ( ))}
{selectedMaterials?.length === 0 && (

Tip: choose at least one material for a better match.

)}
{/* Operations */}
Typical operations (select all that apply)
{[ ["deep_mark_metal", "Deep mark on metal"], ["color_mark_stainless", "Color mark stainless"], ["fine_engraving", "Fine engraving (small features)"], ["photo_engrave", "Photo engraving"], ["cut_nonmetals_thick", "Cut thick non-metals (e.g., 6+ mm acrylic/wood)"], ["cut_nonmetals_thin", "Cut thin non-metals"], ["mark_coated", "Mark coated items"], ].map(([val, label]) => ( ))}
{selectedOps?.length === 0 && (

Tip: pick one or more to sharpen the recommendation.

)}
{/* Size / Detail / Speed / Budget */}
Back to Buying Guide
)} {!!result && (
{result.top[1] && ( )}
Back to Buying Guide
)}
); } function ResultCard({ title, type, why, secondary, }: { title: string; type: LaserType; why?: string[]; secondary?: boolean; }) { const info = TYPE_INFO[type]; return (

{title}

{!secondary && Best match}
{LASER_LABEL[type]}

{info.summary}

{!!why?.length && (
Why this fits
    {why.slice(0, 5).map((w, i) =>
  • {w}
  • )}
)}
See community settings Suggest new settings
); } function TagList({ label, items, tone, }: { label: string; items: string[]; tone?: "warn"; }) { return (
{label}
{items.map((t, i) => ( {t} ))}
); } function CompareMatrix() { const rows: Array<{ k: LaserType; label: string; best: string[]; ok: string[]; avoid: string[]; }> = [ { k: "fiber", label: LASER_LABEL.fiber, best: ["Bare metals", "Deep metal engrave", "Color marking stainless"], ok: ["Some coated items", "Some plastics w/ additives"], avoid: ["Thick organics cutting"], }, { k: "co2_gantry", label: LASER_LABEL.co2_gantry, best: ["Acrylic cutting", "Wood cutting/engraving", "Large panels"], ok: ["Leathers, textiles, rubber"], avoid: ["Bare metals (no coat)"], }, { k: "co2_galvo", label: LASER_LABEL.co2_galvo, best: ["Fast marking organics", "Photo engraving organics"], ok: ["Coated metals/non-metals"], avoid: ["Thick sheet cutting", "Large panels"], }, { k: "uv", label: LASER_LABEL.uv, best: ["Micro features", "Glass/ceramic/plastics marking"], ok: ["Fine logos on coated metals"], avoid: ["Thick cutting"], }, ]; return (
Compare laser types
{rows.map((r) => ( ))}
Type Best for Okay for Not ideal
{r.label} {r.best.join(", ")} {r.ok.join(", ")} {r.avoid.join(", ")}
); }