refactor: simplify chart type icon assignment in ChartRow component

This commit is contained in:
Dhruwang
2026-03-02 11:30:54 +05:30
parent 00c0e5070b
commit 6df40459b5

View File

@@ -18,7 +18,7 @@ interface ChartRowProps {
export function ChartRow({ chart, environmentId, isReadOnly }: Readonly<ChartRowProps>) {
const { t } = useTranslation();
const [isEditDialogOpen, setIsEditDialogOpen] = useState(false);
const IconComponent = CHART_TYPE_ICONS[chart.type as keyof typeof CHART_TYPE_ICONS] ?? BarChart3Icon;
const IconComponent = CHART_TYPE_ICONS[chart.type] ?? BarChart3Icon;
const handleChartClick = () => {
if (!isReadOnly) {