mirror of
https://github.com/supabase/supabase.git
synced 2026-07-02 00:54:25 +08:00
* Fix default size for resizeable panel in table editor * Fix default size for resizeable panel for global * Clean up * nit * Tweak * Adjust
24 lines
782 B
TypeScript
24 lines
782 B
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 { ProjectLayoutWithAuth } from '../ProjectLayout'
|
|
|
|
export const TableEditorLayout = ({ children }: PropsWithChildren<{}>) => {
|
|
const { can: canReadTables, isSuccess: isPermissionsLoaded } = useAsyncCheckPermissions(
|
|
PermissionAction.TENANT_SQL_ADMIN_READ,
|
|
'tables'
|
|
)
|
|
|
|
if (isPermissionsLoaded && !canReadTables) {
|
|
return (
|
|
<ProjectLayoutWithAuth isBlocking={false}>
|
|
<NoPermission isFullPage resourceText="view tables from this project" />
|
|
</ProjectLayoutWithAuth>
|
|
)
|
|
}
|
|
|
|
return children
|
|
}
|