build bug fixes
This commit is contained in:
parent
2c858929e4
commit
bf45c515db
2 changed files with 40 additions and 30 deletions
|
|
@ -6,12 +6,14 @@ import { cn } from "@/lib/utils";
|
|||
import RigsListClient from "@/app/rigs/RigsListClient";
|
||||
import RigBuilderClient from "@/app/rigs/RigBuilderClient";
|
||||
|
||||
type Opt = { id: string | number; label: string };
|
||||
|
||||
const TABS = [
|
||||
{ key: "my", label: "My Rigs" },
|
||||
{ key: "add", label: "Add Rig" },
|
||||
];
|
||||
|
||||
function Panel({ tab }: { tab: string }) {
|
||||
function Panel({ tab, rigTypes }: { tab: string; rigTypes: Opt[] }) {
|
||||
switch (tab) {
|
||||
case "my":
|
||||
return (
|
||||
|
|
@ -22,7 +24,7 @@ function Panel({ tab }: { tab: string }) {
|
|||
case "add":
|
||||
return (
|
||||
<div className="rounded-md border p-4">
|
||||
<RigBuilderClient />
|
||||
<RigBuilderClient rigTypes={rigTypes} />
|
||||
</div>
|
||||
);
|
||||
default:
|
||||
|
|
@ -30,7 +32,7 @@ function Panel({ tab }: { tab: string }) {
|
|||
}
|
||||
}
|
||||
|
||||
export default function RigsSwitcher() {
|
||||
export default function RigsSwitcher({ rigTypes }: { rigTypes: Opt[] }) {
|
||||
const router = useRouter();
|
||||
const sp = useSearchParams();
|
||||
const active = sp.get("t") || "my";
|
||||
|
|
@ -50,7 +52,9 @@ export default function RigsSwitcher() {
|
|||
onClick={() => setTab(key)}
|
||||
className={cn(
|
||||
"rounded-md border px-3 py-1.5 text-sm transition",
|
||||
active === key ? "bg-primary text-primary-foreground" : "hover:bg-muted"
|
||||
active === key
|
||||
? "bg-primary text-primary-foreground"
|
||||
: "hover:bg-muted"
|
||||
)}
|
||||
>
|
||||
{label}
|
||||
|
|
@ -58,7 +62,7 @@ export default function RigsSwitcher() {
|
|||
))}
|
||||
</div>
|
||||
|
||||
<Panel tab={active} />
|
||||
<Panel tab={active} rigTypes={rigTypes} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue