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
Christopher Kolstad 53354224fc
chore: Bump biome and configure husky (#6589)
Upgrades biome to 1.6.1, and updates husky pre-commit hook.

Most changes here are making type imports explicit.
2024-03-18 13:58:05 +01:00

31 lines
801 B
TypeScript

import { createContext } from 'react';
import type { IFeedbackCategory } from 'hooks/useSubmittedFeedback';
export type FeedbackMode = 'automatic' | 'manual';
export interface IFeedbackContext {
feedbackData: FeedbackData | undefined;
openFeedback: (
data: FeedbackData,
mode: FeedbackMode,
variant?: string,
) => void;
closeFeedback: () => void;
showFeedback: boolean;
setShowFeedback: (visible: boolean) => void;
feedbackMode: FeedbackMode | undefined;
}
interface IFeedbackText {
title: string;
positiveLabel: string;
areasForImprovementsLabel: string;
}
export type FeedbackData = IFeedbackText & {
category: IFeedbackCategory;
};
export const FeedbackContext = createContext<IFeedbackContext | undefined>(
undefined,
);