mirror of
https://github.com/supabase/supabase.git
synced 2026-10-07 18:35:07 +03:00
* Minor clean ups * Clean up * Standardize more icon for table and storage editor * update copy
24 lines
835 B
TypeScript
24 lines
835 B
TypeScript
import { PermissionAction } from '@supabase/shared-types/out/constants'
|
|
import { PropsWithChildren } from 'react'
|
|
|
|
import NoPermission from 'components/ui/NoPermission'
|
|
import { useCheckPermissions, usePermissionsLoaded } from 'hooks/misc/useCheckPermissions'
|
|
import { ProjectLayoutWithAuth } from '../ProjectLayout/ProjectLayout'
|
|
|
|
const TableEditorLayout = ({ children }: PropsWithChildren<{}>) => {
|
|
const isPermissionsLoaded = usePermissionsLoaded()
|
|
const canReadTables = useCheckPermissions(PermissionAction.TENANT_SQL_ADMIN_READ, 'tables')
|
|
|
|
if (isPermissionsLoaded && !canReadTables) {
|
|
return (
|
|
<ProjectLayoutWithAuth isBlocking={false}>
|
|
<NoPermission isFullPage resourceText="view tables from this project" />
|
|
</ProjectLayoutWithAuth>
|
|
)
|
|
}
|
|
|
|
return children
|
|
}
|
|
|
|
export default TableEditorLayout
|