-
Notifications
You must be signed in to change notification settings - Fork 346
Expand file tree
/
Copy pathcategories.ts
More file actions
65 lines (60 loc) · 2.76 KB
/
Copy pathcategories.ts
File metadata and controls
65 lines (60 loc) · 2.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/********************************************************************************
* Copyright (c) 2026 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* https://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
********************************************************************************/
import { FunctionComponent } from 'react';
import { SvgIconProps } from '@mui/material';
import DataObjectIcon from '@mui/icons-material/DataObject';
import AutoAwesomeIcon from '@mui/icons-material/AutoAwesome';
import SpellcheckIcon from '@mui/icons-material/Spellcheck';
import FormatAlignLeftIcon from '@mui/icons-material/FormatAlignLeft';
import ContentCopyIcon from '@mui/icons-material/ContentCopy';
import PaletteIcon from '@mui/icons-material/Palette';
import BugReportIcon from '@mui/icons-material/BugReport';
import AccountTreeIcon from '@mui/icons-material/AccountTree';
import KeyboardIcon from '@mui/icons-material/Keyboard';
import ExtensionIcon from '@mui/icons-material/Extension';
import BarChartIcon from '@mui/icons-material/BarChart';
import TranslateIcon from '@mui/icons-material/Translate';
import InsightsIcon from '@mui/icons-material/Insights';
import ModelTrainingIcon from '@mui/icons-material/ModelTraining';
import MenuBookIcon from '@mui/icons-material/MenuBook';
import GridViewIcon from '@mui/icons-material/GridView';
import { CATEGORIES, ExtensionCategory } from '../extension-registry-types';
export const DefaultCategoryIcon: FunctionComponent<SvgIconProps> = GridViewIcon;
// The category list itself lives in extension-registry-types; this record is
// compile-checked to stay exhaustive when categories are added or removed.
export const CATEGORY_ICONS: Record<ExtensionCategory, FunctionComponent<SvgIconProps>> = {
AI: AutoAwesomeIcon,
'Programming Languages': DataObjectIcon,
Snippets: ContentCopyIcon,
Linters: SpellcheckIcon,
Themes: PaletteIcon,
Debuggers: BugReportIcon,
Formatters: FormatAlignLeftIcon,
Keymaps: KeyboardIcon,
'SCM Providers': AccountTreeIcon,
Other: GridViewIcon,
'Extension Packs': ExtensionIcon,
'Language Packs': TranslateIcon,
'Data Science': InsightsIcon,
'Machine Learning': ModelTrainingIcon,
Visualization: BarChartIcon,
Notebooks: MenuBookIcon
};
const SORTED_CATEGORIES: ExtensionCategory[] = [...CATEGORIES].sort((a, b) => {
if (a === 'Other') return 1;
if (b === 'Other') return -1;
return a.localeCompare(b);
});
export function useCategories(): ExtensionCategory[] {
return SORTED_CATEGORIES;
}