"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(); const handleSelect = async (node: LocationTreeNode) => { console.log('node',node); // const node = await locationFindById(value); setSelectedLocation(() => node); } return (
xxx
handleSelect(item)}> {selectedLocation && }
); }