chore: update eslint and prettier configuration
This commit is contained in:
@@ -112,7 +112,12 @@ export const DETECTION_MODES: Record<string, DetectionModeConfig> = {
|
||||
'pothole-detection': {
|
||||
id: 'pothole-detection',
|
||||
label: 'Pothole Detection',
|
||||
enabledTypes: ['pothole', 'road_crack', 'damaged_road_marking', 'drain_issue'],
|
||||
enabledTypes: [
|
||||
'pothole',
|
||||
'road_crack',
|
||||
'damaged_road_marking',
|
||||
'drain_issue',
|
||||
],
|
||||
},
|
||||
'sign-board-detection': {
|
||||
id: 'sign-board-detection',
|
||||
@@ -153,14 +158,19 @@ export const DETECTION_MODES: Record<string, DetectionModeConfig> = {
|
||||
};
|
||||
|
||||
// Fallback config for unknown modes
|
||||
export const DEFAULT_DETECTION_MODE: DetectionModeConfig = DETECTION_MODES['pot-sign-detection'];
|
||||
export const DEFAULT_DETECTION_MODE: DetectionModeConfig =
|
||||
DETECTION_MODES['pot-sign-detection'];
|
||||
|
||||
export const getDetectionModeConfig = (mode?: string): DetectionModeConfig => {
|
||||
if (!mode) return DEFAULT_DETECTION_MODE;
|
||||
return DETECTION_MODES[mode] || DEFAULT_DETECTION_MODE;
|
||||
};
|
||||
|
||||
export const getEnabledDetectionTypes = (mode?: string): DetectionTypeConfig[] => {
|
||||
export const getEnabledDetectionTypes = (
|
||||
mode?: string,
|
||||
): DetectionTypeConfig[] => {
|
||||
const config = getDetectionModeConfig(mode);
|
||||
return config.enabledTypes.map((typeId) => DETECTION_TYPES[typeId]).filter(Boolean);
|
||||
return config.enabledTypes
|
||||
.map((typeId) => DETECTION_TYPES[typeId])
|
||||
.filter(Boolean);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user