import React from 'react';
import { MemoryRouter, Route, Routes } from 'react-router-dom';
import VotingTable from './VotingTable';
import { generateUniqueId } from '../../utils/crypto';

export default {
  title: 'Components/VotingTable',
  component: VotingTable,
};

export const Default = () => {
  const mockSessionId = generateUniqueId();
  const mockUsername = 'testUser';

  return (
    <MemoryRouter initialEntries={[`/session/${mockSessionId}`]}>
      <Routes>
        <Route
          path="/session/:sessionId"
          element={<VotingTable username={mockUsername} />}
        />
      </Routes>
    </MemoryRouter>
  );
};
