🦴 Add results backbone
This commit is contained in:
5
apps/builder/layouts/results/AnalyticsContent.tsx
Normal file
5
apps/builder/layouts/results/AnalyticsContent.tsx
Normal file
@ -0,0 +1,5 @@
|
||||
import React from 'react'
|
||||
|
||||
export const AnalyticsContent = () => {
|
||||
return <>Hi</>
|
||||
}
|
43
apps/builder/layouts/results/ResultsContent.tsx
Normal file
43
apps/builder/layouts/results/ResultsContent.tsx
Normal file
@ -0,0 +1,43 @@
|
||||
import { Button, Flex, HStack, Stack } from '@chakra-ui/react'
|
||||
import { NextChakraLink } from 'components/nextChakra/NextChakraLink'
|
||||
import { useTypebot } from 'contexts/TypebotContext'
|
||||
import { useRouter } from 'next/router'
|
||||
import React, { useMemo } from 'react'
|
||||
import { AnalyticsContent } from './AnalyticsContent'
|
||||
import { SubmissionsContent } from './SubmissionContent'
|
||||
|
||||
export const ResultsContent = () => {
|
||||
const router = useRouter()
|
||||
const { typebot } = useTypebot()
|
||||
const isAnalytics = useMemo(
|
||||
() => router.pathname.endsWith('analytics'),
|
||||
[router.pathname]
|
||||
)
|
||||
return (
|
||||
<Flex h="full" w="full" justifyContent="center" align="flex-start">
|
||||
<Stack maxW="1200px" w="full" pt="4" spacing={6}>
|
||||
<HStack>
|
||||
<Button
|
||||
as={NextChakraLink}
|
||||
colorScheme={!isAnalytics ? 'blue' : 'gray'}
|
||||
variant={!isAnalytics ? 'outline' : 'ghost'}
|
||||
size="sm"
|
||||
href={`/typebots/${typebot?.id}/results`}
|
||||
>
|
||||
Submissions
|
||||
</Button>
|
||||
<Button
|
||||
as={NextChakraLink}
|
||||
colorScheme={isAnalytics ? 'blue' : 'gray'}
|
||||
variant={isAnalytics ? 'outline' : 'ghost'}
|
||||
href={`/typebots/${typebot?.id}/results/analytics`}
|
||||
size="sm"
|
||||
>
|
||||
Analytics
|
||||
</Button>
|
||||
</HStack>
|
||||
{isAnalytics ? <AnalyticsContent /> : <SubmissionsContent />}
|
||||
</Stack>
|
||||
</Flex>
|
||||
)
|
||||
}
|
10
apps/builder/layouts/results/SubmissionContent.tsx
Normal file
10
apps/builder/layouts/results/SubmissionContent.tsx
Normal file
@ -0,0 +1,10 @@
|
||||
import { SubmissionsTable } from 'components/results/SubmissionsTable'
|
||||
import React from 'react'
|
||||
|
||||
export const SubmissionsContent = () => {
|
||||
return (
|
||||
<>
|
||||
<SubmissionsTable />
|
||||
</>
|
||||
)
|
||||
}
|
Reference in New Issue
Block a user