// src/views/Community/components/EventCard/ImportanceBadge.js // 重要性标签通用组件 import React from 'react'; import { Box, Text, HStack, VStack, Popover, PopoverTrigger, PopoverContent, PopoverBody, PopoverArrow, Portal, } from '@chakra-ui/react'; import { getImportanceConfig, getAllImportanceLevels } from '../../../../constants/importanceLevels'; /** * 重要性标签组件(实心样式) * @param {Object} props * @param {string} props.importance - 重要性等级 ('S' | 'A' | 'B' | 'C') * @param {Object} props.position - 定位配置 { top, left, right, bottom },默认为 { top: 0, left: 0 } */ const ImportanceBadge = ({ importance, position = { top: 0, left: 0 } }) => { const importanceConfig = getImportanceConfig(importance); return ( {importanceConfig.label} 重要性等级说明 {getAllImportanceLevels().map(item => ( {item.label} {item.label}: {item.description} ))} ); }; export default ImportanceBadge;