1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-31 00:16:47 +01:00
unleash.unleash/frontend/src/hooks/useSubmittedFeedback.ts

19 lines
536 B
TypeScript

import { createLocalStorage } from '../utils/createLocalStorage';
export type IFeedbackCategory =
| 'search'
| 'newStrategyForm'
| 'insights'
| 'applicationOverview';
export const useUserSubmittedFeedback = (category: IFeedbackCategory) => {
const key = `unleash-userSubmittedFeedback:${category}`;
const { value: hasSubmittedFeedback, setValue: setHasSubmittedFeedback } =
createLocalStorage<Boolean>(key, false);
return {
hasSubmittedFeedback,
setHasSubmittedFeedback,
};
};