import React, { ChangeEvent, Dispatch, SetStateAction, useMemo } from 'react'; import { useHMSTheme } from '../../hooks/HMSThemeProvider'; import { hmsUiClassParserGenerator } from '../../utils/classes'; import { RowLayout } from './RowLayout'; import './index.css'; export interface FeedbackFormClasses { feedbackSection?: string; feedbackIconSection?: string; feedbackColumn?: string; cancelFeedback?: string; checkBoxLabel?: string; feedbackChoiceSection?: string; formLabel?: string; feedbackChoices?: string; } export interface FeedbackFormProps { classes?: FeedbackFormClasses; setShowModal?: (value: boolean) => void; onChoiceChangeHandler: (event: ChangeEvent) => void; setUserComment: Dispatch>; userComment: string; showChoice: boolean; userCommentHandler: (event: ChangeEvent) => void; } const defaultClasses = { feedbackChoiceSection: 'mt-2', formLabel: 'text-sm text-gray-400 mb-2 block', feedbackChoices: 'flex-wrap', }; export const FeedbackForm = ({ classes, onChoiceChangeHandler, userComment, userCommentHandler, showChoice, }: FeedbackFormProps) => { const { tw } = useHMSTheme(); const feedbackOptions = [ 'I could not hear others', 'I could not see others', 'Others could not hear me', 'Others could not see me', 'Poor audio quality', 'Poor video quality', ]; const styler = useMemo( () => hmsUiClassParserGenerator({ tw, classes, defaultClasses, tag: 'hmsui-feedback-form', }), [], ); return (
{feedbackOptions.map((choice: string) => { return ( ); })}
); };