import PodiumStep from './PodiumStep';

export default function Podium({ score }: { score: any }) {
  const podium = [2, 0, 1]
    .reduce((podiumOrder, position) => [...podiumOrder, score[position]] as any, [])
    .filter(Boolean);

  return (
    <div
      className="mt-8 grid grid-flow-col-dense place-content-center content-end items-end justify-center justify-items-center gap-2"
      style={{ height: 250 }}
    >
      {podium.map((group: any, index: number) => (
        <PodiumStep key={index} podium={podium} group={group} index={index} />
      ))}
    </div>
  );
}
