File size: 1,103 Bytes
5916048
 
 
 
 
 
 
 
 
5be784e
5916048
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5be784e
5916048
 
 
 
 
 
5be784e
 
5916048
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"use client";
import { useState } from "react";

import { EditorHeader } from "./header";
import { EditorSidebar } from "./sidebar";
import { EditorMain } from "./main";
import { ApiRoute } from "@/utils/type";
import { API_COLLECTIONS } from "@/utils/datas/api_collections";

export const Editor = ({ children }: any) => {
  const [collections, setCollections] = useState<string[]>(["search"]);
  const [endpoint, setEndpoint] = useState<ApiRoute | null>(
    API_COLLECTIONS[0].endpoints[0]
  );

  return (
    <div className="bg-slate-950 w-full overflow-hidden shadow-xl h-[100vh]">
      <EditorHeader />
      <main className="flex h-full">
        <EditorSidebar
          collections={collections}
          endpoint={endpoint}
          onCollections={setCollections}
          onEndpoint={setEndpoint}
        />
        {/* {endpoint && (
          <EditorMain
            collections={collections}
            endpoint={endpoint}
            onCollections={setCollections}
            onEndpoint={setEndpoint}
          />
        )} */}
        {children}
      </main>
    </div>
  );
};