@@ -40,6 +40,8 @@ import { useEditorType } from '../editors/EditorsLayout.hooks'
4040import { ActionCard } from './ActionCard'
4141import { RecentItems } from './RecentItems'
4242import { SIDEBAR_KEYS } from '../ProjectLayout/LayoutSidebar/LayoutSidebarProvider'
43+ import { useQuerySchemaState } from 'hooks/misc/useSchemaQueryState'
44+ import { useIsProtectedSchema } from 'hooks/useProtectedSchemas'
4345
4446const NEW_PROJECT_THRESHOLD_DAYS = 7
4547const TABLE_QUICKSTART_FLAG = 'tableQuickstart'
@@ -57,6 +59,8 @@ export function NewTab() {
5759 const { profile } = useProfile ( )
5860 const { data : org } = useSelectedOrganizationQuery ( )
5961 const { data : project } = useSelectedProjectQuery ( )
62+ const { selectedSchema } = useQuerySchemaState ( )
63+ const { isSchemaLocked } = useIsProtectedSchema ( { schema : selectedSchema } )
6064
6165 const snap = useTableEditorStateSnapshot ( )
6266 const snapV2 = useSqlEditorV2StateSnapshot ( )
@@ -161,16 +165,18 @@ export function NewTab() {
161165 }
162166 }
163167
164- const tableEditorActions = [
165- {
166- icon : < Table2 className = "h-4 w-4 text-foreground" strokeWidth = { 1.5 } /> ,
167- title : 'Create a table' ,
168- description : 'Design and create a new database table' ,
169- bgColor : 'bg-blue-500' ,
170- isBeta : false ,
171- onClick : ( ) => snap . onAddTable ( ) ,
172- } ,
173- ]
168+ const tableEditorActions = isSchemaLocked
169+ ? [ ]
170+ : [
171+ {
172+ icon : < Table2 className = "h-4 w-4 text-foreground" strokeWidth = { 1.5 } /> ,
173+ title : 'Create a table' ,
174+ description : 'Design and create a new database table' ,
175+ bgColor : 'bg-blue-500' ,
176+ isBeta : false ,
177+ onClick : ( ) => snap . onAddTable ( ) ,
178+ } ,
179+ ]
174180
175181 const sqlEditorActions = [
176182 {
0 commit comments