mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1023 B
42 lines
1023 B
<script setup lang="ts"> |
|
import type { NcButtonSize } from '~/lib' |
|
|
|
const props = defineProps<{ |
|
activeWorkspaceId?: string | undefined |
|
modal?: boolean |
|
type?: string |
|
isOpen: boolean |
|
size?: NcButtonSize |
|
centered?: boolean |
|
}>() |
|
|
|
const { isUIAllowed } = useRoles() |
|
|
|
const { orgRoles, workspaceRoles } = useRoles() |
|
|
|
const projectStore = useProject() |
|
const { isSharedBase } = storeToRefs(projectStore) |
|
|
|
const workspaceStore = useWorkspace() |
|
const { activeWorkspaceId: _activeWorkspaceId } = storeToRefs(workspaceStore) |
|
|
|
const projectCreateDlg = ref(false) |
|
|
|
const size = computed(() => props.size || 'small') |
|
const centered = computed(() => props.centered ?? true) |
|
</script> |
|
|
|
<template> |
|
<NcButton |
|
v-if="isUIAllowed('projectCreate', { roles: workspaceRoles ?? orgRoles }) && !isSharedBase" |
|
type="text" |
|
:size="size" |
|
:centered="centered" |
|
@click="projectCreateDlg = true" |
|
> |
|
<slot /> |
|
<WorkspaceCreateProjectDlg v-model="projectCreateDlg" /> |
|
</NcButton> |
|
</template> |
|
|
|
<style scoped></style>
|
|
|