Files
supabase/apps/studio/components/layouts/ReportsLayout/ReportsLayout.tsx
T
Joshen Lim c4b36d9ab0 Chore/disable more sections 01 (#38057)
* Add flags for policies, third party auth, and manual linking + providers in sign in page

* Add flag for rate limitm page

* Add UnknownInterface components

* Update comment

* Flip flags to true

* Add flags for realtime policies and reports page

* Temp

* Add flag for sign in providers page

* Add flag for stripe wrapper

* Add empty state for realtime policies

* Add empty state for reports page

* nit

* Hide realtime configuration section in side nav if neither policies nor settings are visible
2025-08-20 19:59:43 +08:00

35 lines
932 B
TypeScript

import { PropsWithChildren } from 'react'
import { useParams } from 'common'
import { UnknownInterface } from 'components/ui/UnknownInterface'
import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
import { withAuth } from 'hooks/misc/withAuth'
import ProjectLayout from '../ProjectLayout/ProjectLayout'
import ReportsMenu from './ReportsMenu'
interface ReportsLayoutProps {
title?: string
}
const ReportsLayout = ({ title, children }: PropsWithChildren<ReportsLayoutProps>) => {
const { ref } = useParams()
const { reportsAll } = useIsFeatureEnabled(['reports:all'])
if (reportsAll) {
return (
<ProjectLayout
title={title}
product="Reports"
productMenu={<ReportsMenu />}
isBlocking={false}
>
{children}
</ProjectLayout>
)
} else {
return <UnknownInterface urlBack={`/project/${ref}`} />
}
}
export default withAuth(ReportsLayout)