export default function PwaSprintSelector({ sprints, selectedId, onChange }) {
  if (!sprints || sprints.length <= 1) return null;

  return (
    <label className="pwa-sprint-selector">
      <span>انتخاب اسپرینت</span>
      <select value={selectedId || ''} onChange={(event) => onChange(event.target.value)}>
        {sprints.map((sprint) => (
          <option key={sprint.id} value={sprint.id}>
            {sprint.status === 'active' ? 'اسپرینت فعال - ' : ''}{sprint.title}
          </option>
        ))}
      </select>
    </label>
  );
}
