Spaces:
Runtime error
Runtime error
File size: 1,143 Bytes
56b6519 |
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 |
import { t } from 'i18next';
import React from 'react';
type SidebarProps = {
setActiveView: (view: string) => void;
activeView: string;
};
const Sidebar: React.FC<SidebarProps> = ({ setActiveView, activeView }) => {
const menuItems = [
{ name: t('cvssScore'), id: 'cvss-score' },
{ name: t('remediationPriority'), id: 'remediation-priority' },
{ name: t('remediationComplexity'), id: 'remediation-complexity' },
{ name: 'Average CVSS', id: 'average-cvss' },
{ name: 'CIA Triad', id: 'cia-triad' },
];
return (
<aside className="w-64 bg-gray-800 p-4">
<h2 className="text-xl font-bold mb-6">Select data display</h2>
<nav>
<ul>
{menuItems.map(item => (
<li className="mb-2" key={item.id}>
<button
className={`sidebar-item block ${activeView === item.id ? 'bg-blue-600' : ''}`}
onClick={() => setActiveView(item.id)}
type="button"
>
{item.name}
</button>
</li>
))}
</ul>
</nav>
</aside>
);
};
export default Sidebar;
|