import Link from 'next/link'
import { useRouter } from 'next/router'
import { IconChevronLeft, IconCommand, IconSearch } from 'ui'
import * as NavItems from './NavigationMenu.constants'
// @ts-expect-error
import jsSpec from '~/../../spec/supabase_js_v2_temp_new_shape.yml' assert { type: 'yml' }
// @ts-expect-error
import clientLibsCommon from '~/../../spec/common-client-libs.yml' assert { type: 'yml' }
import { SearchButton } from '~/components/DocSearch'
const NavigationMenuRefList = ({ currentLevel, setLevel, id }) => {
const router = useRouter()
const menu = NavItems[id]
let functions = jsSpec.functions
functions = functions.map((func) => {
let data = {
...func,
}
data = {
...data,
...clientLibsCommon.functions.filter((x) => {
return x.id === func.id
})[0],
}
return data
})
const FunctionLink = ({
title,
id,
icon,
product,
library,
}: {
title: string
name: string
id: string
icon?: string
product?: string
library: string
}) => {
return (
{icon &&
}
{title}
)
}
const SideMenuTitle = ({ title }: { title: string }) => {
return (
{title}
)
}
const Divider = () => {
return
}
return (
{/* {process.env.NEXT_PUBLIC_EXPERIMENTAL_REF !== 'true' && ( */}
Back to Main Menu
{console.log(menu)}
{/* )} */}
{/* {process.env.NEXT_PUBLIC_EXPERIMENTAL_REF !== 'true' && ( */}
{menu.title}
{/* )} */}
{/* {console.log({ clientLibsCommon })} */}
{clientLibsCommon.functions
.filter((x) => x.product === 'database')
.map((x, index) => {
// console.log(functions)
return (
<>
>
)
})}
{clientLibsCommon.functions
.filter((x) => x.product === 'auth')
.map((x, index) => {
// console.log(functions)
return (
<>
>
)
})}
{clientLibsCommon.functions
.filter((x) => x.product === 'storage')
.map((x, index) => {
// console.log(functions)
return (
<>
>
)
})}
{clientLibsCommon.functions
.filter((x) => x.product === 'realtime')
.map((x, index) => {
// console.log(functions)
return (
<>
>
)
})}
{clientLibsCommon.functions
.filter((x) => x.product === 'functions')
.map((x, index) => {
// console.log(functions)
return (
<>
>
)
})}
{menu.extras && (
<>
{' '}
Resources
>
)}
{menu.extras?.map((x) => {
return (
)
})}
)
}
export default NavigationMenuRefList