import Link from 'next/link'
import { useRouter } from 'next/router'
import { IconChevronLeft } 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' }
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,
}: {
title: string
name: string
id: string
icon?: string
}) => {
return (
{icon &&
}
{title}
)
}
const SideMenuTitle = ({ title }: { title: string }) => {
return (
{title}
)
}
const Divider = () => {
return
}
return (
Back to reference
{menu.title ?? currentLevel}
{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