mirror of
https://github.com/supabase/supabase.git
synced 2026-10-12 21:05:06 +03:00
35 lines
922 B
TypeScript
35 lines
922 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'
|
|
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)
|