Files
supabase/apps/studio/components/layouts/LogsLayout/LogsLayout.tsx
CharisandJoshen Lim 3eb7da7766 feat(preferences): allow disable hotkeys (#39573)
* 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>
2025-10-17 08:09:38 -04:00

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)