diff --git a/components/details/CO2GalvoDetail.tsx b/components/details/CO2GalvoDetail.tsx
index d8fdd1d9..976542fa 100644
--- a/components/details/CO2GalvoDetail.tsx
+++ b/components/details/CO2GalvoDetail.tsx
@@ -14,15 +14,25 @@ type Rec = {
photo?: { id?: string } | string | null;
screen?: { id?: string } | string | null;
- // ids & readable fields
mat?: { id?: string | number; name?: string | null } | null;
mat_coat?: { id?: string | number; name?: string | null } | null;
mat_color?: { id?: string | number; name?: string | null } | null;
mat_opacity?: { id?: string | number; opacity?: string | number | null } | null;
mat_thickness?: number | null;
- source?: { submission_id?: string | number; make?: string | null; model?: string | null; nm?: string | null } | null;
- lens?: { id?: string | number; field_size?: string | number | null; focal_length?: string | number | null } | null;
+ source?: {
+ submission_id?: string | number;
+ make?: string | null;
+ model?: string | null;
+ nm?: string | null;
+ } | null;
+
+ lens?: {
+ id?: string | number;
+ field_size?: string | number | null;
+ focal_length?: string | number | null;
+ } | null;
+
focus?: number | null;
laser_soft?: any;
@@ -40,7 +50,11 @@ type Rec = {
async function readJson(res: Response) {
const text = await res.text();
- try { return text ? JSON.parse(text) : null; } catch { throw new Error(`Unexpected response (HTTP ${res.status})`); }
+ try {
+ return text ? JSON.parse(text) : null;
+ } catch {
+ throw new Error(`Unexpected response (HTTP ${res.status})`);
+ }
}
function ownerLabel(o: Rec["owner"]) {
@@ -49,25 +63,15 @@ function ownerLabel(o: Rec["owner"]) {
return o.username || String(o.id ?? "—");
}
-// Use public Directus base for sources so images actually load
+// Public Directus base for
sources
const API_BASE = (process.env.NEXT_PUBLIC_API_BASE_URL || "").replace(/\/$/, "");
function fileUrl(id?: string) {
if (!id) return "";
- if (API_BASE) return `${API_BASE}/assets/${id}`;
- return `/api/dx/assets/${id}`; // fallback if you proxy assets
+ return API_BASE ? `${API_BASE}/assets/${id}` : `/api/dx/assets/${id}`;
}
-/** Small helper to render a square-cropped thumbnail that opens a lightbox on click */
-function ZoomableSquareImage({
- src,
- alt,
- onOpen,
-}: {
- src: string;
- alt: string;
- onOpen: () => void;
-}) {
- // Use CSS aspect-ratio for a consistent 1:1 crop (works without Tailwind plugin)
+function ZoomableSquareImage(props: { src: string; alt: string; onOpen: () => void }) {
+ const { src, alt, onOpen } = props;
return (
Loading setting…
; - if (err) returnSetting not found.
; // EDIT @@ -240,14 +254,24 @@ export default function CO2GalvoDetail({