Files
Joshen Lim 75e1717a02 Remove barrel files part 02 (#39956)
* Remove barrel files part 02

* Clean up
2025-10-30 23:50:14 +08:00

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)