mirror of
https://github.com/supabase/supabase.git
synced 2026-10-13 13:19:09 +03:00
* feat(preferences): allow disable hotkeys Add a section in /account/me for disabling hotkeys. Only added one hotkey for now (Cmd + E for toggling editor side panel) but we can add more with the same pattern. * refactor: remove default export on ProjectLayout * feat(hotkeys): allow toggling of command menu and ai assistant hotkeys * Nit * PRettier lint --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
43 lines
1.2 KiB
TypeScript
43 lines
1.2 KiB
TypeScript
import { PermissionAction } from '@supabase/shared-types/out/constants'
|
|
|
|
import { PropsWithChildren } from 'react'
|
|
|
|
import NoPermission from 'components/ui/NoPermission'
|
|
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
|
|
import { withAuth } from 'hooks/misc/withAuth'
|
|
import { ProjectLayout } from '../ProjectLayout/ProjectLayout'
|
|
import { LogsSidebarMenuV2 } from './LogsSidebarMenuV2'
|
|
|
|
interface LogsLayoutProps {
|
|
title?: string
|
|
}
|
|
|
|
const LogsLayout = ({ title, children }: PropsWithChildren<LogsLayoutProps>) => {
|
|
const { isLoading, can: canUseLogsExplorer } = useAsyncCheckPermissions(
|
|
PermissionAction.ANALYTICS_READ,
|
|
'logflare'
|
|
)
|
|
|
|
if (!canUseLogsExplorer) {
|
|
if (isLoading) {
|
|
return <ProjectLayout isLoading></ProjectLayout>
|
|
}
|
|
|
|
if (!isLoading && !canUseLogsExplorer) {
|
|
return (
|
|
<ProjectLayout>
|
|
<NoPermission isFullPage resourceText="access your project's logs" />
|
|
</ProjectLayout>
|
|
)
|
|
}
|
|
}
|
|
|
|
return (
|
|
<ProjectLayout title={title} product="Logs & Analytics" productMenu={<LogsSidebarMenuV2 />}>
|
|
{children}
|
|
</ProjectLayout>
|
|
)
|
|
}
|
|
|
|
export default withAuth(LogsLayout)
|