2023-12-22 14:09:02 +01:00
|
|
|
import { createContext } from 'react';
|
|
|
|
import { ProvideFeedbackSchema } from '../../openapi';
|
|
|
|
|
|
|
|
interface IFeedbackContext {
|
2023-12-28 13:31:53 +01:00
|
|
|
feedbackData: IFeedbackData | undefined;
|
|
|
|
openFeedback: (data: IFeedbackData) => void;
|
2023-12-22 14:09:02 +01:00
|
|
|
closeFeedback: () => void;
|
|
|
|
showFeedback: boolean;
|
|
|
|
setShowFeedback: (visible: boolean) => void;
|
|
|
|
}
|
|
|
|
|
2023-12-28 13:31:53 +01:00
|
|
|
type IFeedbackText = {
|
|
|
|
title: string;
|
|
|
|
positiveLabel: string;
|
|
|
|
areasForImprovementsLabel: string;
|
2023-12-22 14:09:02 +01:00
|
|
|
};
|
|
|
|
|
2023-12-28 13:31:53 +01:00
|
|
|
export type IFeedbackData = Pick<
|
|
|
|
ProvideFeedbackSchema,
|
|
|
|
'category' | 'userType'
|
|
|
|
> &
|
|
|
|
IFeedbackText;
|
2023-12-22 14:09:02 +01:00
|
|
|
|
2023-12-28 13:31:53 +01:00
|
|
|
export const FeedbackContext = createContext<IFeedbackContext | undefined>(
|
|
|
|
undefined,
|
|
|
|
);
|