Skip to content

Commit ce79de6

Browse files
authored
feat(vsc): add count in sample gallery type filter (#14238)
1 parent 9bab0e8 commit ce79de6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/vscode-extension/src/controls/sampleGallery/sampleFilter.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ export default class SampleFilter extends React.Component<SampleFilterProps, unk
2929
const sampleTechniques = this.props.filterOptions.technologies;
3030
const typeOptions: IDropdownOption[] = sampleTypes.map((type) => {
3131
const selected = this.props.filterTags.indexOf(type) >= 0;
32-
return { key: type, text: type, selected };
32+
const count = this.props.samples.filter((sample) => {
33+
return sample.tags && sample.tags.indexOf(type) >= 0;
34+
}).length;
35+
return { key: type, text: `${type} (${count})`, selected };
3336
});
3437
const languageOptions: IDropdownOption[] = sampleLanguages.map((type) => {
3538
const selected = this.props.filterTags.indexOf(type) >= 0;

0 commit comments

Comments
 (0)