-
-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathSoftwareSelector.jsx
More file actions
49 lines (42 loc) · 1.66 KB
/
Copy pathSoftwareSelector.jsx
File metadata and controls
49 lines (42 loc) · 1.66 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
import { categories } from '../../data/categories';
import { getSoftwareByCategory } from '../../data/software-catalog';
import CategorySection from './CategorySection';
import { useSearchContext } from '../../context/SearchContext';
const SoftwareSelector = () => {
// Sort categories by order
const sortedCategories = [...categories].sort((a, b) => a.order - b.order);
const { searchTerm } = useSearchContext();
return (
<div style={{ marginBottom: '16px' }}>
<div className="win98-inset" style={{ padding: '12px', marginBottom: '12px' }}>
<h2 style={{ fontSize: '14px', fontWeight: 'bold', marginBottom: '6px' }}>
Select Software
</h2>
<p style={{ fontSize: '11px', color: 'var(--win98-gray-dark)' }}>
Choose the applications you want to install. All installations use winget (Windows Package Manager).
</p>
</div>
{sortedCategories.map((category) => {
const categorySoftware = getSoftwareByCategory(category.id);
const filteredSoftware = categorySoftware.filter((sw) => {
if (!searchTerm) return true;
const searchLower = searchTerm.toLowerCase();
return (
sw.name.toLowerCase().includes(searchLower) ||
(sw.description && sw.description.toLowerCase().includes(searchLower))
);
});
if (filteredSoftware.length === 0) return null;
return (
<CategorySection
key={category.id}
category={category}
software={filteredSoftware}
isSearching={!!searchTerm}
/>
);
})}
</div>
);
};
export default SoftwareSelector;