1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-14 00:19:16 +01:00
unleash.unleash/frontend/src/component/feedbackNew/FeedbackContext.ts

25 lines
722 B
TypeScript
Raw Normal View History

import { createContext } from 'react';
import { ProvideFeedbackSchema } from '../../openapi';
import { IFeedbackCategory } from 'hooks/useSubmittedFeedback';
interface IFeedbackContext {
feedbackData: IFeedbackData | undefined;
openFeedback: (data: IFeedbackData) => void;
closeFeedback: () => void;
showFeedback: boolean;
setShowFeedback: (visible: boolean) => void;
}
type IFeedbackText = {
title: string;
positiveLabel: string;
areasForImprovementsLabel: string;
};
export type IFeedbackData = Pick<ProvideFeedbackSchema, 'userType'> &
IFeedbackText & { category: IFeedbackCategory };
export const FeedbackContext = createContext<IFeedbackContext | undefined>(
undefined,
);