Initial commit: NestJS NextJS pnpm monorepo
This commit is contained in:
commit
610dcf202b
175 files changed
+25172
No files matched your search
@@ -0,0 +1,33 @@
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import { LocationTreeNode, Location } from "../../types/inventory";
|
||||
import { LocationTreeView } from "./location.treeView";
|
||||
import { locationFindById } from "../../actions/location.actions";
|
||||
import { LocationForm } from "./location.form";
|
||||
|
||||
|
||||
interface Params {
|
||||
data: LocationTreeNode[]
|
||||
}
|
||||
|
||||
export function LocationView({ data }: Params) {
|
||||
const [selectedLocation, setSelectedLocation] = useState<Location | undefined>();
|
||||
|
||||
const handleSelect = async (node: LocationTreeNode) => {
|
||||
console.log('node',node);
|
||||
// const node = await locationFindById(value);
|
||||
setSelectedLocation(() => node);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="w-120 flex flex-col p-4 pt-10 ps-10">
|
||||
<div>xxx</div>
|
||||
<LocationTreeView data={data} onSelect={(item) => handleSelect(item)}></LocationTreeView>
|
||||
{selectedLocation &&
|
||||
<LocationForm initData={selectedLocation}></LocationForm>
|
||||
}
|
||||
</div>
|
||||
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user