mirror of
https://github.com/supabase/supabase.git
synced 2026-05-07 23:19:23 +08:00
strictNullChecks was off for docs, which lets errors slip through and leads to incorrect required/optional typing on Zod-inferred types. This PR enables strictNullChecks and fixes all the existing violations.
47 lines
1.0 KiB
TypeScript
47 lines
1.0 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, { enabled: !!commonSectionsFile })
|
|
const spec = useSpec(specFile)
|
|
|
|
if (!commonSections) {
|
|
return null
|
|
}
|
|
|
|
if (specFile && !spec) {
|
|
return null
|
|
}
|
|
|
|
const filteredSections = commonSections.filter((section) => {
|
|
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)
|