diff --git a/components/portal/UtilitySwitcher.tsx b/components/portal/UtilitySwitcher.tsx index 66c8a5f6..086058e0 100644 --- a/components/portal/UtilitySwitcher.tsx +++ b/components/portal/UtilitySwitcher.tsx @@ -1,4 +1,3 @@ -// components/portal/UtilitySwitcher.tsx "use client"; import { useEffect, useMemo, useRef, useState } from "react"; @@ -35,71 +34,13 @@ const FileBrowserPanel = dynamic( ); const ITEMS: Item[] = [ - // ✅ Laser Toolkit now renders inline with sub-tabs - { - key: "laser-toolkit", - label: "Laser Toolkit", - note: "convert laser settings, interval and more", - icon: "toolkit.png", - component: LaserToolkitSwitcher, - href: "https://makearmy.io/laser-toolkit", // optional; component takes precedence - }, - -// ✅ File Server inline (no iframe) -{ - key: "files", - label: "File Server", - note: "download from our file explorer", - icon: "fs.png", - component: FileBrowserPanel, - href: "https://makearmy.io/files", -}, - -// Buying Guide moved to main portal tab — remove here to avoid duplication -// { key: "buying-guide", ... } - -// ✅ SVGnest inline (micro-frontend wrapper) -{ - key: "svgnest", - label: "SVGnest", - note: "automatically nests parts and exports svg", - icon: "nest.png", - component: SVGNestPanel, - href: "https://makearmy.io/svgnest", -}, - -// ✅ Background Remover inline -{ - key: "background-remover", - label: "BG Remover", - note: "open source background remover", - icon: "bgrm.png", - component: BackgroundRemoverPanel, - href: "https://makearmy.io/background-remover", -}, - -// Subdomains (new tab) -{ - key: "picsur", - label: "Picsur", - note: "Simple Image Host", - icon: "picsur.png", - href: "https://images.makearmy.io", -}, -{ - key: "privatebin", - label: "PrivateBin", - note: "Encrypted internet clipboard", - icon: "privatebin.png", - href: "https://paste.makearmy.io/", -}, -{ - key: "forgejo", - label: "Forgejo", - note: "git for our community members", - icon: "forgejo.png", - href: "https://forge.makearmy.io", -}, + { key: "laser-toolkit", label: "Laser Toolkit", note: "convert laser settings, interval and more", icon: "toolkit.png", component: LaserToolkitSwitcher, href: "https://makearmy.io/laser-toolkit" }, +{ key: "files", label: "File Server", note: "download from our file explorer", icon: "fs.png", component: FileBrowserPanel, href: "https://makearmy.io/files" }, +{ key: "svgnest", label: "SVGnest", note: "automatically nests parts and exports svg", icon: "nest.png", component: SVGNestPanel, href: "https://makearmy.io/svgnest" }, +{ key: "background-remover", label: "BG Remover", note: "open source background remover", icon: "bgrm.png", component: BackgroundRemoverPanel, href: "https://makearmy.io/background-remover" }, +{ key: "picsur", label: "Picsur", note: "Simple Image Host", icon: "picsur.png", href: "https://images.makearmy.io" }, +{ key: "privatebin", label: "PrivateBin", note: "Encrypted internet clipboard", icon: "privatebin.png", href: "https://paste.makearmy.io/" }, +{ key: "forgejo", label: "Forgejo", note: "git for our community members", icon: "forge.png", href: "https://forge.makearmy.io" }, ]; function isExternal(urlStr: string | undefined) { @@ -112,7 +53,6 @@ function isExternal(urlStr: string | undefined) { } } -/** For on-site URLs, convert absolute https://makearmy.io/path → /path for iframe src */ function toOnsitePath(urlStr: string): string { try { const u = new URL(urlStr); @@ -128,7 +68,7 @@ function Panel({ item }: { item: Item }) { const Cmp = item.component; return (
- {item.note ?
{item.note}
: null} + {/* Removed notes/headers to keep UI clean */}
); @@ -138,16 +78,8 @@ function Panel({ item }: { item: Item }) { if (external) { return (
-
- Opened {item.label} in a new tab. -
- - Click here if it didn’t open. + + Open {item.label}
); @@ -155,15 +87,13 @@ function Panel({ item }: { item: Item }) { const src = toOnsitePath(item.href || "/"); return ( -
- {item.note ?
{item.note}
: null}