'use client' import React from 'react' interface DetectorDataPoint { value: number label?: string timestamp?: string status?: string } interface DetectorChartProps { className?: string data?: DetectorDataPoint[] type?: 'line' | 'bar' } const DetectorChart: React.FC = ({ className = '', type = 'line' }) => { if (type === 'bar') { const barData = [ { value: 85, label: 'Янв' }, { value: 70, label: 'Фев' }, { value: 90, label: 'Мар' }, { value: 65, label: 'Апр' }, { value: 80, label: 'Май' }, { value: 95, label: 'Июн' } ] return (
{barData.map((bar, index) => { const barWidth = 50 const barSpacing = 15 const x = index * (barWidth + barSpacing) + 20 const barHeight = (bar.value / 100) * 150 const y = 160 - barHeight return ( {bar.label} ) })}
) } return (
) } export default DetectorChart