@@ -2,6 +2,7 @@
|
||||
|
||||
import { useState, useTransition } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import StepViewerPanel from "@/components/StepViewerPanel";
|
||||
|
||||
type ScanFile = { id: string; originalName: string; kind: string };
|
||||
|
||||
@@ -77,16 +78,17 @@ export default function ScanClient({ initialOp, viewer }: { initialOp: ScanOp; v
|
||||
const totalUnits = op.part.assembly.qty * op.part.qty;
|
||||
|
||||
// Flat list of attached files (part first, then assembly). Rendered as big
|
||||
// tap targets so the operator can pull the drawing / STEP right from the
|
||||
// scan page without bouncing to the admin UI.
|
||||
// tap targets so the operator can pull the drawing / cut file right from
|
||||
// the scan page without bouncing to the admin UI.
|
||||
//
|
||||
// STEP files are intentionally excluded — we render them inline via
|
||||
// StepViewerPanel below instead, so the operator never has to download a
|
||||
// .stp to the phone.
|
||||
const quickFiles: Array<{ label: string; file: ScanFile; scope: "part" | "assembly" }> = [];
|
||||
if (op.part.drawingFile) quickFiles.push({ label: "Drawing", file: op.part.drawingFile, scope: "part" });
|
||||
if (op.part.stepFile) quickFiles.push({ label: "3D / STEP", file: op.part.stepFile, scope: "part" });
|
||||
if (op.part.cutFile) quickFiles.push({ label: "Cut file", file: op.part.cutFile, scope: "part" });
|
||||
if (op.part.assembly.drawingFile)
|
||||
quickFiles.push({ label: "Assembly drawing", file: op.part.assembly.drawingFile, scope: "assembly" });
|
||||
if (op.part.assembly.stepFile)
|
||||
quickFiles.push({ label: "Assembly 3D", file: op.part.assembly.stepFile, scope: "assembly" });
|
||||
if (op.part.assembly.cutFile)
|
||||
quickFiles.push({ label: "Assembly cut", file: op.part.assembly.cutFile, scope: "assembly" });
|
||||
|
||||
@@ -246,6 +248,28 @@ export default function ScanClient({ initialOp, viewer }: { initialOp: ScanOp; v
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{op.part.stepFile ? (
|
||||
<div className="rounded-2xl bg-white border border-slate-200 p-5">
|
||||
<StepViewerPanel
|
||||
title="Part 3D"
|
||||
fileId={op.part.stepFile.id}
|
||||
fileName={op.part.stepFile.originalName}
|
||||
height={320}
|
||||
/>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{op.part.assembly.stepFile ? (
|
||||
<div className="rounded-2xl bg-white border border-slate-200 p-5">
|
||||
<StepViewerPanel
|
||||
title="Assembly 3D"
|
||||
fileId={op.part.assembly.stepFile.id}
|
||||
fileName={op.part.assembly.stepFile.originalName}
|
||||
height={320}
|
||||
/>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{op.instructions ? (
|
||||
<div className="rounded-2xl bg-white border border-slate-200 p-5">
|
||||
<h2 className="text-sm font-semibold text-slate-900 mb-1">Instructions</h2>
|
||||
|
||||
Reference in New Issue
Block a user