()
| 9 | type LinkThunk = (state: DashboardValue) => string; |
| 10 | |
| 11 | export function useLinks() { |
| 12 | const dashboard = useDashboard(); |
| 13 | const get = useCallback( |
| 14 | (thunk: LinkThunk): string => thunk(dashboard), |
| 15 | [dashboard], |
| 16 | ); |
| 17 | return get; |
| 18 | } |
| 19 | |
| 20 | function withFilter(path: string, filter: string) { |
| 21 | return path + (filter ? `?filter=${encodeURIComponent(filter)}` : ""); |
no test coverage detected