mirror of
https://github.com/azaion/ui.git
synced 2026-04-22 06:56:33 +00:00
30 lines
1.1 KiB
JavaScript
30 lines
1.1 KiB
JavaScript
// src/components/DetectionContainer.js
|
|
import React from 'react';
|
|
import Detection from './Detection';
|
|
|
|
function DetectionContainer({ detections, selectedDetectionIndices, calculateColor, onDetectionMouseDown, currentDetection, onResize }) {
|
|
|
|
return (
|
|
<>
|
|
{detections.map((detection, index) => (
|
|
<Detection
|
|
key={index}
|
|
detection={detection}
|
|
isSelected={selectedDetectionIndices.includes(index)}
|
|
onDetectionMouseDown={(e) => onDetectionMouseDown(e, index)}
|
|
onResize={(e, position) => onResize(e, index, position)}
|
|
/>
|
|
))}
|
|
{currentDetection && (
|
|
<Detection
|
|
detection={currentDetection}
|
|
isSelected={false}
|
|
onDetectionMouseDown={() => {}} // No-op handler for the current detection
|
|
onResize={() => {}} // No-op handler for the current detection
|
|
/>
|
|
)}
|
|
</>
|
|
);
|
|
}
|
|
|
|
export default DetectionContainer; |