"use client"; import dynamic from "next/dynamic"; import { useMemo } from "react"; import { useRouter, useSearchParams } from "next/navigation"; import { cn } from "@/lib/utils"; const LaserToolkit = dynamic( () => import("@/components/portal/LaserToolkitSwitcher"), { ssr: false } ); const FileBrowser = dynamic( () => import("@/components/utilities/files/FileBrowserPanel"), { ssr: false } ); const BackgroundRemover = dynamic( () => import("@/components/utilities/BackgroundRemoverPanel"), { ssr: false } ); const TOOLS = [ { key: "laser-toolkit", label: "Laser Toolkit", description: "Calculators for beam size, overlap, hatch spacing, job time, and more.", icon: "/images/utils/toolkit.png", component: LaserToolkit, }, { key: "files", label: "File Server", description: "Browse, preview, and download files from the public library.", icon: "/images/utils/fs.png", component: FileBrowser, }, { key: "background-remover", label: "Background Remover", description: "Remove image backgrounds using our self-hosted processing service.", icon: "/images/utils/bgrm.png", component: BackgroundRemover, }, ] as const; export default function TemporaryUtilityHub() { const router = useRouter(); const searchParams = useSearchParams(); const activeKey = searchParams.get("tool") || TOOLS[0].key; const active = useMemo( () => TOOLS.find((tool) => tool.key === activeKey) || TOOLS[0], [activeKey] ); const ActiveTool = active.component; function selectTool(key: string) { const query = new URLSearchParams(searchParams.toString()); query.set("tool", key); if (key !== "laser-toolkit") query.delete("lt"); router.replace(`/?${query.toString()}`, { scroll: false }); } return (

Laser Everything

Community Utilities

Our database and member features are temporarily offline while we change backend systems. These free utilities remain available without an account.

{/* eslint-disable-next-line @next/next/no-img-element */}

{active.label}

{active.description}

); }