INNER CODE UNIT · JavaScript
filteredTools
collabnix/kubetools · portal/KubeToolsPortal.js:173
const filteredTools = tools.filter(tool => {
const matchesCategory = selectedCategory === 'All' || tool.category === selectedCategory;
const matchesSearch = tool.name.toLowerCase().includes(searchQuery.toLowerCase()) ||
tool.description.toLowerCase().includes(searchQuery.toLowerCase());
return matchesCategory && matchesSearch;
});
// Handle vote
const handleVote = (toolName) => {
setVotes(prevVotes => ({
...prevVotes,
[toolName]: prevVotes[toolName] + 1
}));
};
// Format stars count for display
const formatStars = (count) => {
if (count >= 1000) {