import PwaSprintEmptyState from './PwaSprintEmptyState';
import PwaSprintTaskCard from './PwaSprintTaskCard';

export default function PwaSprintStatusColumn({ title, tasks, permissions, onStatus, onComment, onDone }) {
  return (
    <section className="pwa-sprint-column">
      <div className="pwa-sprint-column-head">
        <h3>{title}</h3>
        <span>{tasks.length.toLocaleString('fa-IR')}</span>
      </div>
      {tasks.length ? (
        <div className="pwa-sprint-column-tasks">
          {tasks.map((task) => (
            <PwaSprintTaskCard key={task.id} task={task} permissions={permissions} onStatus={onStatus} onComment={onComment} onDone={onDone} />
          ))}
        </div>
      ) : (
        <PwaSprintEmptyState message="تسکی در این وضعیت نیست." />
      )}
    </section>
  );
}
