mirror of
https://github.com/supabase/supabase.git
synced 2026-07-04 19:24:53 +08:00
* exclude dart, python, and swift from error codes menu * Update the error code doc to be client lib agnostic * run formatter * Add a filter to filter out section items * Update apps/docs/components/Navigation/NavigationMenu/NavigationMenuRefList.tsx * docs: move error codes table in a separate component * Add auth error codes section for kotlin
53 lines
1.2 KiB
TypeScript
53 lines
1.2 KiB
TypeScript
import { useCommonSections, useSpec } from './NavigationMenu.utils'
|
|
import NavigationMenuRefListItems from './NavigationMenuRefListItems'
|
|
|
|
import React from 'react'
|
|
|
|
interface NavigationMenuRefListProps {
|
|
id: string
|
|
basePath: string
|
|
commonSectionsFile: string
|
|
specFile?: string
|
|
}
|
|
|
|
const NavigationMenuRefList = ({
|
|
id,
|
|
basePath,
|
|
commonSectionsFile,
|
|
specFile,
|
|
}: NavigationMenuRefListProps) => {
|
|
const commonSections = useCommonSections(commonSectionsFile)
|
|
const spec = useSpec(specFile)
|
|
|
|
if (!commonSections) {
|
|
return null
|
|
}
|
|
|
|
if (specFile && !spec) {
|
|
return null
|
|
}
|
|
|
|
const filteredSections = commonSections.filter((section) => {
|
|
if (section.type === 'category') {
|
|
section.items = section.items.filter((item) => {
|
|
return !item.excludes?.includes(id)
|
|
})
|
|
}
|
|
|
|
return !section.excludes?.includes(id)
|
|
})
|
|
|
|
return (
|
|
<div className="transition-all duration-150 ease-out opacity-100 ml-0 delay-150 h-auto">
|
|
<NavigationMenuRefListItems
|
|
id={id}
|
|
commonSections={filteredSections}
|
|
spec={spec}
|
|
basePath={basePath}
|
|
/>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default React.memo(NavigationMenuRefList)
|