2
0

Add usage-based new pricing plans

This commit is contained in:
Baptiste Arnaud
2022-09-17 16:37:33 +02:00
committed by Baptiste Arnaud
parent 6a1eaea700
commit 898367a33b
144 changed files with 4631 additions and 1624 deletions

View File

@ -1,10 +1,8 @@
import { Stack } from '@chakra-ui/react'
import { SubmissionsTable } from 'components/results/ResultsTable'
import React, { useState } from 'react'
import { UnlockPlanInfo } from 'components/shared/Info'
import { LogsModal } from './LogsModal'
import { useTypebot } from 'contexts/TypebotContext'
import { Plan } from 'db'
import { useResults } from 'contexts/ResultsProvider'
import { ResultModal } from './ResultModal'
@ -14,7 +12,6 @@ export const ResultsContent = () => {
fetchMore,
hasMore,
resultHeader,
totalHiddenResults,
tableData,
} = useResults()
const { typebot, publishedTypebot } = useTypebot()
@ -46,13 +43,6 @@ export const ResultsContent = () => {
overflow="scroll"
w="full"
>
{totalHiddenResults && (
<UnlockPlanInfo
buttonLabel={`Unlock ${totalHiddenResults} results`}
contentLabel="You are seeing complete submissions only."
plan={Plan.PRO}
/>
)}
{publishedTypebot && (
<LogsModal
typebotId={publishedTypebot?.typebotId}

View File

@ -38,7 +38,6 @@ export const ResultsActionButtons = ({
resultHeader,
mutate,
totalResults,
totalHiddenResults,
tableData,
onDeleteResults,
} = useResults()
@ -57,7 +56,7 @@ export const ResultsActionButtons = ({
const totalSelected =
selectedResultsId.length > 0 && selectedResultsId.length === results?.length
? totalResults - (totalHiddenResults ?? 0)
? totalResults
: selectedResultsId.length
const deleteResults = async () => {
@ -87,9 +86,7 @@ export const ResultsActionButtons = ({
const exportResultsToCSV = async () => {
setIsExportLoading(true)
const isSelectAll =
totalSelected === 0 ||
totalSelected === totalResults - (totalHiddenResults ?? 0)
const isSelectAll = totalSelected === 0 || totalSelected === totalResults
const dataToUnparse = isSelectAll
? await getAllTableData()