Commit for testing (#3892)
This commit is contained in:
committed by
GitHub
parent
60a05d3626
commit
e05ce471ee
@@ -181,7 +181,7 @@
|
||||
</div>
|
||||
<div
|
||||
ref="scrollableControlsContainer"
|
||||
:class="`simple-scrollbar absolute z-10 pl-12 pr-2 md:pr-0 md:pl-14 mb-4 max-h-[calc(100dvh-4.5rem)] overflow-y-auto px-[2px] py-[2px] ${
|
||||
:class="`simple-scrollbar absolute z-10 pl-12 pr-2 md:pr-0 md:pl-14 mb-4 max-h-[calc(100dvh-3.5rem)] overflow-y-auto px-[2px] py-[2px] ${
|
||||
activePanel !== 'none' ? 'opacity-100' : 'opacity-0'
|
||||
} ${isEmbedEnabled ? 'mt-1.5' : 'mt-[3.7rem]'}`"
|
||||
:style="`width: ${isMobile ? '100%' : `${width + 4}px`};`"
|
||||
|
||||
@@ -17,30 +17,18 @@
|
||||
</template>
|
||||
<div v-if="!loading" class="pt-3">
|
||||
<div class="px-3 flex flex-col gap-y-3">
|
||||
<CommonAlert v-if="!limits" color="danger" size="xs">
|
||||
<template #title>No credits available</template>
|
||||
<template #description>
|
||||
<div class="leading-snug">
|
||||
AI Renders are only available on
|
||||
<NuxtLink
|
||||
class="border-b border-outline-3 hover:border-outline-5 pb-px leading-none"
|
||||
external
|
||||
to="https://app.speckle.systems"
|
||||
target="_blank"
|
||||
>
|
||||
app.speckle.systems
|
||||
</NuxtLink>
|
||||
</div>
|
||||
</template>
|
||||
</CommonAlert>
|
||||
<CommonAlert v-else-if="!activeUser" color="danger" size="xs">
|
||||
<CommonAlert v-if="!activeUser" color="danger" size="xs">
|
||||
<template #title>Sign in required</template>
|
||||
<template #description>
|
||||
<div class="leading-snug">Please sign in to generate AI renders</div>
|
||||
</template>
|
||||
</CommonAlert>
|
||||
<CommonAlert v-else-if="!canContribute" color="danger" size="xs">
|
||||
<template #title>You do not have permission</template>
|
||||
</CommonAlert>
|
||||
<CommonAlert v-else-if="!limits" color="neutral" size="xs">
|
||||
<template #title>No credits available</template>
|
||||
</CommonAlert>
|
||||
<CommonAlert v-else-if="isOutOfCredits" color="neutral" size="xs">
|
||||
<template #title>Credits reset on {{ formattedResetDate }}</template>
|
||||
<template #title>Out of credits</template>
|
||||
<template #description>Credits reset on {{ formattedResetDate }}</template>
|
||||
</CommonAlert>
|
||||
<div class="flex flex-col gap-y-3">
|
||||
<FormTextArea
|
||||
@@ -66,19 +54,7 @@
|
||||
<ArrowTopRightOnSquareIcon class="h-3 w-3" />
|
||||
</div>
|
||||
</FormButton>
|
||||
|
||||
<div
|
||||
v-if="!limits"
|
||||
:key="`gendo-tooltip-${buttonDisabled}`"
|
||||
v-tippy="`No credits available`"
|
||||
>
|
||||
<FormButton disabled>Generate</FormButton>
|
||||
</div>
|
||||
<div
|
||||
v-else
|
||||
:key="`gendo-tooltip-${buttonDisabled}`"
|
||||
v-tippy="tooltipMessage"
|
||||
>
|
||||
<div :key="`gendo-tooltip-${buttonDisabled}`" v-tippy="tooltipMessage">
|
||||
<FormButton :disabled="buttonDisabled" @click="enqueMagic()">
|
||||
Generate
|
||||
</FormButton>
|
||||
@@ -190,7 +166,8 @@ const textAreaDisabled = computed(() => {
|
||||
timeOutWait.value ||
|
||||
isOutOfCredits.value ||
|
||||
!canContribute.value ||
|
||||
!activeUser.value
|
||||
!activeUser.value ||
|
||||
!limits.value
|
||||
)
|
||||
})
|
||||
|
||||
@@ -198,6 +175,14 @@ const buttonDisabled = computed(() => {
|
||||
return !prompt.value || textAreaDisabled.value
|
||||
})
|
||||
|
||||
const tooltipMessage = computed(() => {
|
||||
if (!activeUser.value) return 'You must be logged in'
|
||||
if (!canContribute.value) return 'Project permissions required'
|
||||
if (isOutOfCredits.value) return 'No credits remaining'
|
||||
if (!limits.value) return 'No credits available'
|
||||
return undefined
|
||||
})
|
||||
|
||||
const randomPlaceholder = computed(() => {
|
||||
const randomIndex = Math.floor(Math.random() * suggestedPrompts.value.length)
|
||||
return suggestedPrompts.value[randomIndex]
|
||||
@@ -286,11 +271,4 @@ const lodgeRequest = async (screenshot: string) => {
|
||||
isLoading.value = false
|
||||
refetch()
|
||||
}
|
||||
|
||||
const tooltipMessage = computed(() => {
|
||||
if (!activeUser.value) return 'You must be logged in'
|
||||
if (!canContribute.value) return 'Project permissions required'
|
||||
if (isOutOfCredits.value) return 'No credits remaining'
|
||||
return undefined
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user