diff --git a/src/frontend/src/features/rooms/components/Rating.tsx b/src/frontend/src/features/rooms/components/Rating.tsx index b25c1087..e873a326 100644 --- a/src/frontend/src/features/rooms/components/Rating.tsx +++ b/src/frontend/src/features/rooms/components/Rating.tsx @@ -1,9 +1,10 @@ -import { Button, H, Text } from '@/primitives' -import { useState } from 'react' +import { Button, H, Text, TextArea } from '@/primitives' +import { useEffect, useState } from 'react' import { cva } from '@/styled-system/css' import { useTranslation } from 'react-i18next' -import { styled } from '@/styled-system/jsx' +import { styled, VStack } from '@/styled-system/jsx' import { usePostHog } from 'posthog-js/react' +import { PostHog } from 'posthog-js' const Card = styled('div', { base: { @@ -13,6 +14,8 @@ const Card = styled('div', { marginTop: '1.5rem', borderRadius: '0.25rem', boxShadow: '', + minWidth: '380px', + minHeight: '196px', }, }) @@ -65,8 +68,76 @@ const labelRecipe = cva({ }, }) -export const Rating = ({ maxRating = 7, ...props }) => { - const posthog = usePostHog() +const OpenFeedback = ({ + posthog, + onNext, +}: { + posthog: PostHog + onNext: () => void +}) => { + const { t } = useTranslation('rooms', { keyPrefix: 'openFeedback' }) + const [feedback, setFeedback] = useState('') + + const onContinue = () => { + setFeedback('') + onNext() + } + + const onSubmit = () => { + try { + posthog.capture('survey sent', { + $survey_id: '01933c5a-5a1d-0000-ada8-e39f5918c2d4', + $survey_response: feedback, + }) + } catch (e) { + console.warn(e) + } finally { + onContinue() + } + } + + return ( + + {t('question')} +