import { FC } from 'react';
import { TowerProps } from '../types';
import DiskComponent from './Disk';

const Tower: FC<TowerProps> = ({ disks, towerIndex, onMove, otherTowers }) => {
	return (
		<div className="border p-3 mb-3" style={{ minHeight: '300px' }}>
			<h2 className="text-center">Wieża {towerIndex + 1}</h2>
			<div className="d-flex flex-column-reverse">
				{disks.map(disk => (
					<DiskComponent
						key={disk.id}
						disk={disk}
						fromTower={towerIndex}
						otherTowers={otherTowers}
						onMove={onMove}
					/>
				))}
			</div>
		</div>
	);
};

export default Tower;
