-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a60c997
commit 4f374e9
Showing
8 changed files
with
150 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import React from "react" | ||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs" | ||
import { PCBViewer } from "@tscircuit/pcb-viewer" | ||
import { CadViewer } from "@tscircuit/3d-viewer" | ||
import { CircuitJsonTableViewer } from "./TableViewer/CircuitJsonTableViewer" | ||
import { AnyCircuitElement } from "circuit-json" | ||
|
||
interface OrderPreviewContentProps { | ||
circuitJson: AnyCircuitElement[] | null | ||
className?: string | ||
} | ||
|
||
export const OrderPreviewContent: React.FC<OrderPreviewContentProps> = ({ | ||
circuitJson, | ||
className, | ||
}) => { | ||
return ( | ||
<div className={className}> | ||
<Tabs defaultValue="pcb" className="w-full"> | ||
<TabsList> | ||
<TabsTrigger value="pcb">PCB</TabsTrigger> | ||
<TabsTrigger value="cad">3D</TabsTrigger> | ||
<TabsTrigger value="table">JSON</TabsTrigger> | ||
</TabsList> | ||
<TabsContent value="pcb"> | ||
<div className="h-[500px]"> | ||
{circuitJson ? ( | ||
<PCBViewer soup={circuitJson} /> | ||
) : ( | ||
<div className="flex items-center justify-center h-full bg-gray-100"> | ||
No PCB data available | ||
</div> | ||
)} | ||
</div> | ||
</TabsContent> | ||
<TabsContent value="cad"> | ||
<div className="h-[500px]"> | ||
{circuitJson ? ( | ||
<CadViewer soup={circuitJson as any} /> | ||
) : ( | ||
<div className="flex items-center justify-center h-full bg-gray-100"> | ||
No 3D data available | ||
</div> | ||
)} | ||
</div> | ||
</TabsContent> | ||
<TabsContent value="table"> | ||
<div className="h-[500px] overflow-auto"> | ||
{circuitJson ? ( | ||
<CircuitJsonTableViewer elements={circuitJson} /> | ||
) : ( | ||
<div className="flex items-center justify-center h-full bg-gray-100"> | ||
No JSON data available | ||
</div> | ||
)} | ||
</div> | ||
</TabsContent> | ||
</Tabs> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters