// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import React from 'react';
import { StarSurvey } from './StarSurvey';
import { TagsSurvey } from './TagsSurvey';
import { useState } from 'react';
import { Stack } from '@fluentui/react';
/**
 * @private
 */
export const SurveyContent = (props) => {
    const [showTagsSurvey, setShowTagsSurvey] = useState(false);
    const onStarRatingSelected = (ratings) => {
        if (ratings < 5) {
            setShowTagsSurvey(true);
            props.setShowSubmitFeedbackButton(true);
        }
        else {
            props.setShowSubmitFeedbackButton(true);
        }
        props.setRatings(ratings);
    };
    const onIssuesSelected = (selectedTags, improvementSuggestions) => {
        props.setIssuesSelected(selectedTags);
        props.setShowSubmitFeedbackButton(true);
        if (improvementSuggestions && props.setImprovementSuggestions) {
            props.setImprovementSuggestions(improvementSuggestions);
        }
    };
    return React.createElement(Stack, { "data-ui-id": "call-composite-survey" },
        React.createElement(StarSurvey, { onStarRatingSelected: onStarRatingSelected }),
        showTagsSurvey && React.createElement(TagsSurvey, { onConfirm: onIssuesSelected, showFreeFormTextField: !(props.setImprovementSuggestions === undefined) }));
};
//# sourceMappingURL=SurveyContent.js.map