1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-12 13:48:35 +02:00
unleash.unleash/frontend/src/hooks/useSubmittedFeedback.ts
Gastón Fournier abe160eb7d
feat: Unleash v7 ESM migration (#9877)
We're migrating to ESM, which will allow us to import the latest
versions of our dependencies.

Co-Authored-By: Christopher Kolstad <chriswk@getunleash.io>
2025-05-14 09:47:12 +02:00

21 lines
580 B
TypeScript

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