feat(frontend): add API client, layout, and routing
- Create Axios-based API client with sources, jobs, and dashboard endpoints - Add responsive Layout component with navigation sidebar - Set up React Router with Dashboard, Backups, and Settings routes - Configure TanStack Query provider with default options - Use lucide-react for navigation icons
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
import uniqBy from 'lodash/uniqBy';
|
||||
import isFunction from 'lodash/isFunction';
|
||||
|
||||
/**
|
||||
* This is configuration option that decides how to filter for unique values only:
|
||||
*
|
||||
* - `false` means "no filter"
|
||||
* - `true` means "use recharts default filter"
|
||||
* - function means "use return of this function as the default key"
|
||||
*/
|
||||
|
||||
export function getUniqPayload(payload, option, defaultUniqBy) {
|
||||
if (option === true) {
|
||||
return uniqBy(payload, defaultUniqBy);
|
||||
}
|
||||
if (isFunction(option)) {
|
||||
return uniqBy(payload, option);
|
||||
}
|
||||
return payload;
|
||||
}
|
||||
Reference in New Issue
Block a user