1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-06 00:07:44 +01:00
unleash.unleash/frontend/src/component/common/Table/SearchHighlightContext/SearchHighlightContext.tsx
olav 34f848ce8a refactor: replace react-dnd with custom implementation (#988)
* refactor: replace react-dnd with custom implementation

* refactor: add TextCell, IconCell, and ActionCell

* refactor: port environments list to react-table

* refactor: change OfflineBolt to PowerSettingsNew

* refactor: simplify environment toast text

* refactor: improve IToast type type

* refactor: improve useSearchHighlightContext naming

* refactor: clarify enableDragAndDrop logic
2022-05-25 11:40:20 +02:00

10 lines
317 B
TypeScript

import { createContext, useContext } from 'react';
const SearchHighlightContext = createContext('');
export const SearchHighlightProvider = SearchHighlightContext.Provider;
export const useSearchHighlightContext = (): { searchQuery: string } => {
return { searchQuery: useContext(SearchHighlightContext) };
};