import React from 'react'; import { Box, Typography } from '@mui/material'; interface UnipuckProps { pucks: number; // Number of pucks samples?: string[][]; // Array of sample arrays for each puck } const Unipuck: React.FC = ({ pucks, samples }) => { const renderPuck = (sampleStatus: string[]) => { sampleStatus = sampleStatus || Array(16).fill('empty'); // Ensure no null status array return ( {[...Array(11)].map((_, index) => { const angle = (index * (360 / 11)) * (Math.PI / 180); const x = 50 + 35 * Math.cos(angle); const y = 50 + 35 * Math.sin(angle); return ; })} {[...Array(5)].map((_, index) => { const angle = (index * (360 / 5) + 36) * (Math.PI / 180); const x = 50 + 15 * Math.cos(angle); const y = 50 + 15 * Math.sin(angle); return ; })} ); }; if (pucks === 0) { return No pucks attached to the dewar.; } return ( {[...Array(pucks)].map((_, index) => ( {renderPuck(samples && samples[index] ? samples[index] : Array(16).fill('empty'))} ))} ); }; export default Unipuck;