Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

fix: wrap resizable panels component in client only

Brad Barbin39a5ba715097
diff --git a/apps/erp/app/routes/x+/inventory+/quantities.tsx b/apps/erp/app/routes/x+/inventory+/quantities.tsx
index b3d74dd959..6d3afa059b 100644
--- a/apps/erp/app/routes/x+/inventory+/quantities.tsx
+++ b/apps/erp/app/routes/x+/inventory+/quantities.tsx
@@ -1,12 +1,7 @@
import { error } from "@carbon/auth";
import { requirePermissions } from "@carbon/auth/auth.server";
import { flash } from "@carbon/auth/session.server";
-import {
- ClientOnly,
- ResizablePanel,
- ResizablePanelGroup,
- VStack,
-} from "@carbon/react";
+import { ResizablePanel, ResizablePanelGroup, VStack } from "@carbon/react";
import { Outlet, useLoaderData } from "@remix-run/react";
import type { LoaderFunctionArgs } from "@vercel/remix";
import { json, redirect } from "@vercel/remix";
@@ -111,27 +106,23 @@ export default function QuantitiesRoute() {
return (
<VStack spacing={0} className="h-full ">
- <ClientOnly>
- {() => (
- <ResizablePanelGroup direction="horizontal">
- <ResizablePanel
- defaultSize={50}
- maxSize={70}
- minSize={25}
- className="bg-background"
- >
- <InventoryTable
- data={inventoryItems}
- count={count}
- locationId={locationId}
- forms={forms}
- substances={substances}
- />
- </ResizablePanel>
- <Outlet />
- </ResizablePanelGroup>
- )}
- </ClientOnly>
+ <ResizablePanelGroup direction="horizontal">
+ <ResizablePanel
+ defaultSize={50}
+ maxSize={70}
+ minSize={25}
+ className="bg-background"
+ >
+ <InventoryTable
+ data={inventoryItems}
+ count={count}
+ locationId={locationId}
+ forms={forms}
+ substances={substances}
+ />
+ </ResizablePanel>
+ <Outlet />
+ </ResizablePanelGroup>
</VStack>
);
}
diff --git a/apps/erp/app/routes/x+/job+/$jobId.tsx b/apps/erp/app/routes/x+/job+/$jobId.tsx
index 34105c3c00..97cdf3602e 100644
--- a/apps/erp/app/routes/x+/job+/$jobId.tsx
+++ b/apps/erp/app/routes/x+/job+/$jobId.tsx
@@ -1,7 +1,6 @@
import { error } from "@carbon/auth";
import { requirePermissions } from "@carbon/auth/auth.server";
import { flash } from "@carbon/auth/session.server";
-import { ClientOnly } from "@carbon/react";
import {
Await,
defer,
@@ -88,38 +87,34 @@ export default function JobRoute() {
<JobHeader />
<div className="flex h-[calc(100dvh-99px)] overflow-hidden w-full">
<div className="flex flex-grow overflow-hidden">
- <ClientOnly fallback={null}>
- {() => (
- <ResizablePanels
- explorer={
- <div className="grid w-full h-[calc(100dvh-99px)] overflow-hidden p-2">
- <Suspense fallback={<ExplorerSkeleton />}>
- <Await
- resolve={method}
- errorElement={
- <div className="p-2 text-red-500">
- Error loading job tree.
- </div>
- }
- >
- {(resolvedMethod) => (
- <JobBoMExplorerWrapper
- method={resolvedMethod.data ?? []}
- />
- )}
- </Await>
- </Suspense>
- </div>
- }
- content={
- <div className="h-[calc(100dvh-99px)] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full">
- <Outlet />
- </div>
- }
- properties={<JobProperties />}
- />
- )}
- </ClientOnly>
+ <ResizablePanels
+ explorer={
+ <div className="grid w-full h-[calc(100dvh-99px)] overflow-hidden p-2">
+ <Suspense fallback={<ExplorerSkeleton />}>
+ <Await
+ resolve={method}
+ errorElement={
+ <div className="p-2 text-red-500">
+ Error loading job tree.
+ </div>
+ }
+ >
+ {(resolvedMethod) => (
+ <JobBoMExplorerWrapper
+ method={resolvedMethod.data ?? []}
+ />
+ )}
+ </Await>
+ </Suspense>
+ </div>
+ }
+ content={
+ <div className="h-[calc(100dvh-99px)] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full">
+ <Outlet />
+ </div>
+ }
+ properties={<JobProperties />}
+ />
</div>
</div>
</div>
diff --git a/apps/erp/app/routes/x+/part+/$itemId.details.tsx b/apps/erp/app/routes/x+/part+/$itemId.details.tsx
index bb285213a2..2b3d513e3e 100644
--- a/apps/erp/app/routes/x+/part+/$itemId.details.tsx
+++ b/apps/erp/app/routes/x+/part+/$itemId.details.tsx
@@ -4,7 +4,6 @@ import { flash } from "@carbon/auth/session.server";
import { validationError, validator } from "@carbon/form";
import type { JSONContent } from "@carbon/react";
import {
- ClientOnly,
ResizableHandle,
ResizablePanel,
ResizablePanelGroup,
@@ -90,162 +89,158 @@ export default function PartDetailsRoute() {
return (
<div className="flex flex-grow overflow-hidden">
- <ClientOnly fallback={null}>
- {() => (
- <ResizablePanelGroup direction="horizontal">
- <ResizablePanel
- order={1}
- minSize={10}
- defaultSize={20}
- className="bg-card"
- >
- <ScrollArea className="h-[calc(100dvh-99px)]">
- <div className="grid h-full overflow-hidden p-2">
- <Suspense fallback={<UsedInSkeleton />}>
- <Await resolve={usedIn}>
- {(resolvedUsedIn) => {
- const {
- jobMaterials,
- jobs,
- methodMaterials,
- purchaseOrderLines,
- receiptLines,
- quoteLines,
- quoteMaterials,
- salesOrderLines,
- shipmentLines,
- } = resolvedUsedIn;
-
- const tree: UsedInNode[] = [
- {
- key: "jobs",
- name: "Jobs",
- module: "production",
- children: jobs.map((job) => ({
- ...job,
- methodType: "Make",
- })),
- },
- {
- key: "jobMaterials",
- name: "Job Materials",
- module: "production",
- children: jobMaterials,
- },
- {
- key: "methodMaterials",
- name: "Method Materials",
- module: "parts",
- // @ts-expect-error
- children: methodMaterials,
- },
- {
- key: "purchaseOrderLines",
- name: "Purchase Orders",
- module: "purchasing",
- children: purchaseOrderLines.map((po) => ({
- ...po,
- methodType: "Buy",
- })),
- },
- {
- key: "receiptLines",
- name: "Receipts",
- module: "inventory",
- children: receiptLines.map((receipt) => ({
- ...receipt,
- methodType: "Pick",
- })),
- },
- {
- key: "quoteLines",
- name: "Quotes",
- module: "sales",
- children: quoteLines,
- },
- {
- key: "quoteMaterials",
- name: "Quote Materials",
- module: "sales",
- children: quoteMaterials?.map((qm) => ({
- ...qm,
- documentReadableId: qm.documentReadableId ?? "",
- })),
- },
- {
- key: "salesOrderLines",
- name: "Sales Orders",
- module: "sales",
- children: salesOrderLines,
- },
- {
- key: "shipmentLines",
- name: "Shipments",
- module: "inventory",
- children: shipmentLines.map((shipment) => ({
- ...shipment,
- methodType: "Shipment",
- })),
- },
- ];
-
- return (
- <UsedInTree
- tree={tree}
- itemReadableId={partData.partSummary?.id ?? ""}
- />
- );
- }}
+ <ResizablePanelGroup direction="horizontal">
+ <ResizablePanel
+ order={1}
+ minSize={10}
+ defaultSize={20}
+ className="bg-card"
+ >
+ <ScrollArea className="h-[calc(100dvh-99px)]">
+ <div className="grid h-full overflow-hidden p-2">
+ <Suspense fallback={<UsedInSkeleton />}>
+ <Await resolve={usedIn}>
+ {(resolvedUsedIn) => {
+ const {
+ jobMaterials,
+ jobs,
+ methodMaterials,
+ purchaseOrderLines,
+ receiptLines,
+ quoteLines,
+ quoteMaterials,
+ salesOrderLines,
+ shipmentLines,
+ } = resolvedUsedIn;
+
+ const tree: UsedInNode[] = [
+ {
+ key: "jobs",
+ name: "Jobs",
+ module: "production",
+ children: jobs.map((job) => ({
+ ...job,
+ methodType: "Make",
+ })),
+ },
+ {
+ key: "jobMaterials",
+ name: "Job Materials",
+ module: "production",
+ children: jobMaterials,
+ },
+ {
+ key: "methodMaterials",
+ name: "Method Materials",
+ module: "parts",
+ // @ts-expect-error
+ children: methodMaterials,
+ },
+ {
+ key: "purchaseOrderLines",
+ name: "Purchase Orders",
+ module: "purchasing",
+ children: purchaseOrderLines.map((po) => ({
+ ...po,
+ methodType: "Buy",
+ })),
+ },
+ {
+ key: "receiptLines",
+ name: "Receipts",
+ module: "inventory",
+ children: receiptLines.map((receipt) => ({
+ ...receipt,
+ methodType: "Pick",
+ })),
+ },
+ {
+ key: "quoteLines",
+ name: "Quotes",
+ module: "sales",
+ children: quoteLines,
+ },
+ {
+ key: "quoteMaterials",
+ name: "Quote Materials",
+ module: "sales",
+ children: quoteMaterials?.map((qm) => ({
+ ...qm,
+ documentReadableId: qm.documentReadableId ?? "",
+ })),
+ },
+ {
+ key: "salesOrderLines",
+ name: "Sales Orders",
+ module: "sales",
+ children: salesOrderLines,
+ },
+ {
+ key: "shipmentLines",
+ name: "Shipments",
+ module: "inventory",
+ children: shipmentLines.map((shipment) => ({
+ ...shipment,
+ methodType: "Shipment",
+ })),
+ },
+ ];
+
+ return (
+ <UsedInTree
+ tree={tree}
+ itemReadableId={partData.partSummary?.id ?? ""}
+ />
+ );
+ }}
+ </Await>
+ </Suspense>
+ </div>
+ </ScrollArea>
+ </ResizablePanel>
+ <ResizableHandle withHandle />
+ <ResizablePanel order={2} minSize={40} defaultSize={60}>
+ <ScrollArea className="h-[calc(100dvh-99px)]">
+ <VStack spacing={2} className="p-2">
+ <ItemNotes
+ id={partData.partSummary?.itemId ?? null}
+ title={partData.partSummary?.name ?? ""}
+ subTitle={partData.partSummary?.id ?? ""}
+ notes={partData.partSummary?.notes as JSONContent}
+ />
+ {permissions.is("employee") && (
+ <>
+ <Suspense
+ fallback={
+ <div className="flex w-full h-full rounded bg-gradient-to-tr from-background to-card items-center justify-center">
+ <Spinner className="h-10 w-10" />
+ </div>
+ }
+ >
+ <Await resolve={partData?.files}>
+ {(resolvedFiles) => (
+ <ItemDocuments
+ files={resolvedFiles}
+ itemId={itemId}
+ modelUpload={partData.partSummary ?? undefined}
+ type="Part"
+ />
+ )}
</Await>
</Suspense>
- </div>
- </ScrollArea>
- </ResizablePanel>
- <ResizableHandle withHandle />
- <ResizablePanel order={2} minSize={40} defaultSize={60}>
- <ScrollArea className="h-[calc(100dvh-99px)]">
- <VStack spacing={2} className="p-2">
- <ItemNotes
- id={partData.partSummary?.itemId ?? null}
- title={partData.partSummary?.name ?? ""}
- subTitle={partData.partSummary?.id ?? ""}
- notes={partData.partSummary?.notes as JSONContent}
+
+ <CadModel
+ isReadOnly={!permissions.can("update", "parts")}
+ metadata={{ itemId }}
+ modelPath={partData?.partSummary?.modelPath ?? null}
+ title="CAD Model"
/>
- {permissions.is("employee") && (
- <>
- <Suspense
- fallback={
- <div className="flex w-full h-full rounded bg-gradient-to-tr from-background to-card items-center justify-center">
- <Spinner className="h-10 w-10" />
- </div>
- }
- >
- <Await resolve={partData?.files}>
- {(resolvedFiles) => (
- <ItemDocuments
- files={resolvedFiles}
- itemId={itemId}
- modelUpload={partData.partSummary ?? undefined}
- type="Part"
- />
- )}
- </Await>
- </Suspense>
-
- <CadModel
- isReadOnly={!permissions.can("update", "parts")}
- metadata={{ itemId }}
- modelPath={partData?.partSummary?.modelPath ?? null}
- title="CAD Model"
- />
- </>
- )}
- </VStack>
- </ScrollArea>
- </ResizablePanel>
- </ResizablePanelGroup>
- )}
- </ClientOnly>
+ </>
+ )}
+ </VStack>
+ </ScrollArea>
+ </ResizablePanel>
+ </ResizablePanelGroup>
</div>
);
}
diff --git a/apps/erp/app/routes/x+/part+/$itemId.manufacturing.tsx b/apps/erp/app/routes/x+/part+/$itemId.manufacturing.tsx
index b9a89a8916..182ca817d8 100644
--- a/apps/erp/app/routes/x+/part+/$itemId.manufacturing.tsx
+++ b/apps/erp/app/routes/x+/part+/$itemId.manufacturing.tsx
@@ -1,6 +1,5 @@
import type { JSONContent } from "@carbon/react";
import {
- ClientOnly,
ResizableHandle,
ResizablePanel,
ResizablePanelGroup,
@@ -150,34 +149,30 @@ export default function PartManufacturing() {
return (
<div className="flex flex-grow overflow-hidden">
- <ClientOnly fallback={null}>
- {() => (
- <ResizablePanelGroup direction="horizontal">
- <ResizablePanel
- order={1}
- minSize={10}
- defaultSize={20}
- className="bg-card"
- >
- <ScrollArea className="h-[calc(100dvh-99px)]">
- <div className="grid h-full overflow-hidden p-2">
- <BoMExplorer
- itemType="Part"
- // @ts-ignore
- methods={methods}
- />
- </div>
- </ScrollArea>
- </ResizablePanel>
- <ResizableHandle withHandle />
- <ResizablePanel order={2} minSize={40} defaultSize={60}>
- <ScrollArea className="h-[calc(100dvh-99px)]">
- <Outlet key={JSON.stringify(params)} />
- </ScrollArea>
- </ResizablePanel>
- </ResizablePanelGroup>
- )}
- </ClientOnly>
+ <ResizablePanelGroup direction="horizontal">
+ <ResizablePanel
+ order={1}
+ minSize={10}
+ defaultSize={20}
+ className="bg-card"
+ >
+ <ScrollArea className="h-[calc(100dvh-99px)]">
+ <div className="grid h-full overflow-hidden p-2">
+ <BoMExplorer
+ itemType="Part"
+ // @ts-ignore
+ methods={methods}
+ />
+ </div>
+ </ScrollArea>
+ </ResizablePanel>
+ <ResizableHandle withHandle />
+ <ResizablePanel order={2} minSize={40} defaultSize={60}>
+ <ScrollArea className="h-[calc(100dvh-99px)]">
+ <Outlet key={JSON.stringify(params)} />
+ </ScrollArea>
+ </ResizablePanel>
+ </ResizablePanelGroup>
</div>
);
}
diff --git a/apps/erp/app/routes/x+/purchase-invoice+/$invoiceId.tsx b/apps/erp/app/routes/x+/purchase-invoice+/$invoiceId.tsx
index 995f6a6c3a..e7d0a01986 100644
--- a/apps/erp/app/routes/x+/purchase-invoice+/$invoiceId.tsx
+++ b/apps/erp/app/routes/x+/purchase-invoice+/$invoiceId.tsx
@@ -1,7 +1,7 @@
import { error } from "@carbon/auth";
import { requirePermissions } from "@carbon/auth/auth.server";
import { flash } from "@carbon/auth/session.server";
-import { ClientOnly, VStack } from "@carbon/react";
+import { VStack } from "@carbon/react";
import { Outlet, useParams } from "@remix-run/react";
import type { ActionFunctionArgs, LoaderFunctionArgs } from "@vercel/remix";
import { defer, redirect } from "@vercel/remix";
@@ -88,21 +88,17 @@ export default function PurchaseInvoiceRoute() {
<PurchaseInvoiceHeader />
<div className="flex h-[calc(100dvh-99px)] overflow-hidden w-full">
<div className="flex flex-grow overflow-hidden">
- <ClientOnly fallback={null}>
- {() => (
- <ResizablePanels
- explorer={<PurchaseInvoiceExplorer />}
- content={
- <div className="h-[calc(100dvh-99px)] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full">
- <VStack spacing={2} className="p-2">
- <Outlet />
- </VStack>
- </div>
- }
- properties={<PurchaseInvoiceProperties />}
- />
- )}
- </ClientOnly>
+ <ResizablePanels
+ explorer={<PurchaseInvoiceExplorer />}
+ content={
+ <div className="h-[calc(100dvh-99px)] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full">
+ <VStack spacing={2} className="p-2">
+ <Outlet />
+ </VStack>
+ </div>
+ }
+ properties={<PurchaseInvoiceProperties />}
+ />
</div>
</div>
</div>
diff --git a/apps/erp/app/routes/x+/purchase-order+/$orderId.tsx b/apps/erp/app/routes/x+/purchase-order+/$orderId.tsx
index e98587c877..b3e8d4dcd1 100644
--- a/apps/erp/app/routes/x+/purchase-order+/$orderId.tsx
+++ b/apps/erp/app/routes/x+/purchase-order+/$orderId.tsx
@@ -1,7 +1,7 @@
import { error } from "@carbon/auth";
import { requirePermissions } from "@carbon/auth/auth.server";
import { flash } from "@carbon/auth/session.server";
-import { ClientOnly, VStack } from "@carbon/react";
+import { VStack } from "@carbon/react";
import { Outlet, useParams } from "@remix-run/react";
import type { LoaderFunctionArgs } from "@vercel/remix";
import { defer, redirect } from "@vercel/remix";
@@ -105,21 +105,17 @@ export default function PurchaseOrderRoute() {
<PurchaseOrderHeader />
<div className="flex h-[calc(100dvh-99px)] overflow-hidden w-full">
<div className="flex flex-grow overflow-hidden">
- <ClientOnly fallback={null}>
- {() => (
- <ResizablePanels
- explorer={<PurchaseOrderExplorer />}
- content={
- <div className="h-[calc(100dvh-99px)] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full">
- <VStack spacing={2} className="p-2">
- <Outlet />
- </VStack>
- </div>
- }
- properties={<PurchaseOrderProperties />}
- />
- )}
- </ClientOnly>
+ <ResizablePanels
+ explorer={<PurchaseOrderExplorer />}
+ content={
+ <div className="h-[calc(100dvh-99px)] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full">
+ <VStack spacing={2} className="p-2">
+ <Outlet />
+ </VStack>
+ </div>
+ }
+ properties={<PurchaseOrderProperties />}
+ />
</div>
</div>
</div>
diff --git a/apps/erp/app/routes/x+/quote+/$quoteId.tsx b/apps/erp/app/routes/x+/quote+/$quoteId.tsx
index 97a07749db..ce58f04182 100644
--- a/apps/erp/app/routes/x+/quote+/$quoteId.tsx
+++ b/apps/erp/app/routes/x+/quote+/$quoteId.tsx
@@ -1,7 +1,7 @@
import { error, getCarbonServiceRole } from "@carbon/auth";
import { requirePermissions } from "@carbon/auth/auth.server";
import { flash } from "@carbon/auth/session.server";
-import { ClientOnly, VStack } from "@carbon/react";
+import { VStack } from "@carbon/react";
import { Outlet, useLoaderData, useParams } from "@remix-run/react";
import type { PostgrestResponse } from "@supabase/supabase-js";
import type { LoaderFunctionArgs } from "@vercel/remix";
@@ -140,21 +140,17 @@ export default function QuoteRoute() {
<QuoteHeader />
<div className="flex h-[calc(100dvh-99px)] overflow-hidden w-full">
<div className="flex flex-grow overflow-hidden">
- <ClientOnly fallback={null}>
- {() => (
- <ResizablePanels
- explorer={<QuoteExplorer methods={methods} />}
- content={
- <div className="h-[calc(100dvh-99px)] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full">
- <VStack spacing={2} className="p-2">
- <Outlet />
- </VStack>
- </div>
- }
- properties={<QuoteProperties />}
- />
- )}
- </ClientOnly>
+ <ResizablePanels
+ explorer={<QuoteExplorer methods={methods} />}
+ content={
+ <div className="h-[calc(100dvh-99px)] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full">
+ <VStack spacing={2} className="p-2">
+ <Outlet />
+ </VStack>
+ </div>
+ }
+ properties={<QuoteProperties />}
+ />
</div>
</div>
</div>
diff --git a/apps/erp/app/routes/x+/sales-order+/$orderId.tsx b/apps/erp/app/routes/x+/sales-order+/$orderId.tsx
index 8104c360fc..5318845f79 100644
--- a/apps/erp/app/routes/x+/sales-order+/$orderId.tsx
+++ b/apps/erp/app/routes/x+/sales-order+/$orderId.tsx
@@ -1,7 +1,7 @@
import { error } from "@carbon/auth";
import { requirePermissions } from "@carbon/auth/auth.server";
import { flash } from "@carbon/auth/session.server";
-import { ClientOnly, VStack } from "@carbon/react";
+import { VStack } from "@carbon/react";
import { Outlet, useParams } from "@remix-run/react";
import type { LoaderFunctionArgs } from "@vercel/remix";
import { defer, redirect } from "@vercel/remix";
@@ -87,21 +87,17 @@ export default function SalesOrderRoute() {
<SalesOrderHeader />
<div className="flex h-[calc(100dvh-99px)] overflow-hidden w-full">
<div className="flex flex-grow overflow-hidden">
- <ClientOnly fallback={null}>
- {() => (
- <ResizablePanels
- explorer={<SalesOrderExplorer />}
- content={
- <div className="h-[calc(100dvh-99px)] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full">
- <VStack spacing={2} className="p-2">
- <Outlet />
- </VStack>
- </div>
- }
- properties={<SalesOrderProperties />}
- />
- )}
- </ClientOnly>
+ <ResizablePanels
+ explorer={<SalesOrderExplorer />}
+ content={
+ <div className="h-[calc(100dvh-99px)] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full">
+ <VStack spacing={2} className="p-2">
+ <Outlet />
+ </VStack>
+ </div>
+ }
+ properties={<SalesOrderProperties />}
+ />
</div>
</div>
</div>
diff --git a/apps/erp/app/routes/x+/sales-rfq+/$rfqId.tsx b/apps/erp/app/routes/x+/sales-rfq+/$rfqId.tsx
index d65681e0e3..040bb176d6 100644
--- a/apps/erp/app/routes/x+/sales-rfq+/$rfqId.tsx
+++ b/apps/erp/app/routes/x+/sales-rfq+/$rfqId.tsx
@@ -1,9 +1,4 @@
-import {
- ClientOnly,
- supportedModelTypes,
- VStack,
- type JSONContent,
-} from "@carbon/react";
+import { supportedModelTypes, VStack, type JSONContent } from "@carbon/react";
import type { DragEndEvent } from "@dnd-kit/core";
import { DndContext } from "@dnd-kit/core";
import { Outlet, useParams, useSubmit } from "@remix-run/react";
@@ -152,21 +147,17 @@ export default function SalesRFQRoute() {
<SalesRFQHeader />
<div className="flex h-[calc(100dvh-99px)] overflow-hidden w-full">
<div className="flex flex-grow overflow-hidden">
- <ClientOnly fallback={null}>
- {() => (
- <ResizablePanels
- explorer={<SalesRFQExplorer />}
- content={
- <div className="h-[calc(100dvh-99px)] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full">
- <VStack spacing={2} className="p-2">
- <Outlet />
- </VStack>
- </div>
- }
- properties={<SalesRFQProperties />}
- />
- )}
- </ClientOnly>
+ <ResizablePanels
+ explorer={<SalesRFQExplorer />}
+ content={
+ <div className="h-[calc(100dvh-99px)] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-accent w-full">
+ <VStack spacing={2} className="p-2">
+ <Outlet />
+ </VStack>
+ </div>
+ }
+ properties={<SalesRFQProperties />}
+ />
</div>
</div>
</div>
diff --git a/apps/erp/app/routes/x+/tool+/$itemId.manufacturing.tsx b/apps/erp/app/routes/x+/tool+/$itemId.manufacturing.tsx
index 1038ee0151..2f4fad8bb6 100644
--- a/apps/erp/app/routes/x+/tool+/$itemId.manufacturing.tsx
+++ b/apps/erp/app/routes/x+/tool+/$itemId.manufacturing.tsx
@@ -1,6 +1,5 @@
import type { JSONContent } from "@carbon/react";
import {
- ClientOnly,
ResizableHandle,
ResizablePanel,
ResizablePanelGroup,
@@ -115,34 +114,30 @@ export default function ToolManufacturing() {
return (
<div className="flex flex-grow overflow-hidden">
- <ClientOnly fallback={null}>
- {() => (
- <ResizablePanelGroup direction="horizontal">
- <ResizablePanel
- order={1}
- minSize={10}
- defaultSize={20}
- className="bg-card"
- >
- <ScrollArea className="h-[calc(100dvh-99px)]">
- <div className="grid h-full overflow-hidden p-2">
- <BoMExplorer
- itemType="Tool"
- // @ts-ignore
- methods={methods}
- />
- </div>
- </ScrollArea>
- </ResizablePanel>
- <ResizableHandle withHandle />
- <ResizablePanel order={2} minSize={40} defaultSize={60}>
- <ScrollArea className="h-[calc(100dvh-99px)]">
- <Outlet key={JSON.stringify(params)} />
- </ScrollArea>
- </ResizablePanel>
- </ResizablePanelGroup>
- )}
- </ClientOnly>
+ <ResizablePanelGroup direction="horizontal">
+ <ResizablePanel
+ order={1}
+ minSize={10}
+ defaultSize={20}
+ className="bg-card"
+ >
+ <ScrollArea className="h-[calc(100dvh-99px)]">
+ <div className="grid h-full overflow-hidden p-2">
+ <BoMExplorer
+ itemType="Tool"
+ // @ts-ignore
+ methods={methods}
+ />
+ </div>
+ </ScrollArea>
+ </ResizablePanel>
+ <ResizableHandle withHandle />
+ <ResizablePanel order={2} minSize={40} defaultSize={60}>
+ <ScrollArea className="h-[calc(100dvh-99px)]">
+ <Outlet key={JSON.stringify(params)} />
+ </ScrollArea>
+ </ResizablePanel>
+ </ResizablePanelGroup>
</div>
);
}
diff --git a/packages/react/src/Resizable.tsx b/packages/react/src/Resizable.tsx
index a94b9a6abf..9492cc0268 100644
--- a/packages/react/src/Resizable.tsx
+++ b/packages/react/src/Resizable.tsx
@@ -4,18 +4,23 @@ import { LuGripVertical } from "react-icons/lu";
import * as ResizablePrimitive from "react-resizable-panels";
import { cn } from "./utils/cn";
+import { ClientOnly } from "./ClientOnly";
const ResizablePanelGroup = ({
className,
...props
}: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => (
- <ResizablePrimitive.PanelGroup
- className={cn(
- "flex h-full w-full data-[panel-group-direction=vertical]:flex-col",
- className
+ <ClientOnly fallback={null}>
+ {() => (
+ <ResizablePrimitive.PanelGroup
+ className={cn(
+ "flex h-full w-full data-[panel-group-direction=vertical]:flex-col",
+ className
+ )}
+ {...props}
+ />
)}
- {...props}
- />
+ </ClientOnly>
);
const ResizablePanel = ResizablePrimitive.Panel;