This commit is contained in:
2026-03-14 23:03:17 -05:00
parent ce6dec316e
commit 8bf69c67e0
22 changed files with 1660 additions and 175 deletions

View File

@@ -0,0 +1,22 @@
import { FileAttachmentsPanel } from "../../components/FileAttachmentsPanel";
import { inventoryFileOwnerType } from "./config";
export function InventoryAttachmentsPanel({
itemId,
onAttachmentCountChange,
}: {
itemId: string;
onAttachmentCountChange?: (count: number) => void;
}) {
return (
<FileAttachmentsPanel
ownerType={inventoryFileOwnerType}
ownerId={itemId}
eyebrow="Attachments"
title="Drawings and support docs"
description="Store drawings, cut sheets, work instructions, and other manufacturing support files on the item record."
emptyMessage="No drawings or support documents have been added to this item yet."
onAttachmentCountChange={onAttachmentCountChange}
/>
);
}

View File

@@ -6,6 +6,7 @@ import { Link, useParams } from "react-router-dom";
import { useAuth } from "../../auth/AuthProvider";
import { api, ApiError } from "../../lib/api";
import { emptyInventoryTransactionInput, inventoryTransactionOptions } from "./config";
import { InventoryAttachmentsPanel } from "./InventoryAttachmentsPanel";
import { InventoryStatusBadge } from "./InventoryStatusBadge";
import { InventoryTransactionTypeBadge } from "./InventoryTransactionTypeBadge";
import { InventoryTypeBadge } from "./InventoryTypeBadge";
@@ -355,6 +356,7 @@ export function InventoryDetailPage() {
)}
</article>
</section>
<InventoryAttachmentsPanel itemId={item.id} />
</section>
);
}

View File

@@ -92,6 +92,8 @@ export const inventoryStatusPalette: Record<InventoryItemStatus, string> = {
OBSOLETE: "border border-rose-400/30 bg-rose-500/12 text-rose-700 dark:text-rose-300",
};
export const inventoryFileOwnerType = "inventory-item";
export const inventoryTypePalette: Record<InventoryItemType, string> = {
PURCHASED: "border border-slate-400/30 bg-slate-500/12 text-slate-700 dark:text-slate-300",
MANUFACTURED: "border border-amber-400/30 bg-amber-500/12 text-amber-700 dark:text-amber-300",