"use client"; import { TbChevronDown } from "react-icons/tb"; import classNames from "classnames"; import { API_COLLECTIONS } from "@/utils/datas/api_collections"; import { Method } from "@/components/method"; import { ApiRoute } from "@/utils/type"; export const EditorSidebar = ({ collections, endpoint, onCollections, onEndpoint, }: { collections: string[]; endpoint: ApiRoute | null; onCollections: (collections: string[]) => void; onEndpoint: (endpoint: ApiRoute) => void; }) => { const handleSetActiveCollection = (key: string) => { if (collections.includes(key)) { onCollections(collections.filter((col) => col !== key)); } else { onCollections([...collections, key]); } }; // useUpdateEffect(() => { // if (collections) { // const first_endpoint = API_COLLECTIONS.find( // (col) => col.key === collections // )?.endpoints[0]; // if (first_endpoint) onEndpoint(first_endpoint); // } // }, [collections]); return ( ); };