import PwaSprintStatusColumn from './PwaSprintStatusColumn';

const columns = [
  { key: 'waiting', title: 'در انتظار', statuses: ['waiting'] },
  { key: 'todo', title: 'برای انجام', statuses: ['todo'] },
  { key: 'in_progress', title: 'در حال انجام', statuses: ['in_progress', 'review'] },
  { key: 'done', title: 'انجام‌شده', statuses: ['done'] },
];

export default function PwaSprintBoard({ tasks, permissions, onStatus, onComment, onDone }) {
  return (
    <div className="pwa-sprint-board">
      {columns.map((column) => (
        <PwaSprintStatusColumn
          key={column.key}
          title={column.title}
          tasks={tasks.filter((task) => column.statuses.includes(task.status))}
          permissions={permissions}
          onStatus={onStatus}
          onComment={onComment}
          onDone={onDone}
        />
      ))}
    </div>
  );
}
