import React from 'react' import { useTranslation } from 'react-i18next' import { useGraphStore } from '@/stores/graph' import { Card } from '@/components/ui/Card' import { ScrollArea } from '@/components/ui/ScrollArea' interface LegendProps { className?: string } const Legend: React.FC = ({ className }) => { const { t } = useTranslation() const typeColorMap = useGraphStore.use.typeColorMap() if (!typeColorMap || typeColorMap.size === 0) { return null } return (

{t('graphPanel.legend')}

{Array.from(typeColorMap.entries()).map(([type, color]) => (
{t(`graphPanel.nodeTypes.${type.toLowerCase()}`, type)}
))}
) } export default Legend