Clean up: Remove component files
This commit is contained in:
parent
f255414f34
commit
6faa3b145f
@ -1,78 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
import { Task, TaskStatus } from '../../types';
|
|
||||||
import { AssigneeLabel, DueDate, PriorityIndicator, StatusSelect } from '../common/TaskFields';
|
|
||||||
|
|
||||||
interface TaskRowProps {
|
|
||||||
task: Task;
|
|
||||||
busy: boolean;
|
|
||||||
onEdit: (task: Task) => void;
|
|
||||||
onDelete: (task: Task) => void;
|
|
||||||
onStatusChange: (task: Task, status: TaskStatus) => void;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Desktop table row. Column order follows the approved dashboard mockup. */
|
|
||||||
const TaskRow: React.FC<TaskRowProps> = ({ task, busy, onEdit, onDelete, onStatusChange }) => (
|
|
||||||
<div className="task-row" role="row">
|
|
||||||
<div className="task-cell priority" role="cell">
|
|
||||||
<PriorityIndicator priority={task.priority} />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="task-cell task-name" role="cell">
|
|
||||||
<div className="task-title-container">
|
|
||||||
{/* Distinct name from the pencil button so the two controls are
|
|
||||||
tellable apart in a screen reader's list of links and buttons. */}
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className="task-title-btn"
|
|
||||||
onClick={() => onEdit(task)}
|
|
||||||
aria-label={`Open ${task.title}`}
|
|
||||||
>
|
|
||||||
<span className="task-title">{task.title}</span>
|
|
||||||
</button>
|
|
||||||
{task.description && <span className="task-description">{task.description}</span>}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="task-cell assignee" role="cell">
|
|
||||||
<AssigneeLabel user={task.assigned_to} />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="task-cell status" role="cell">
|
|
||||||
<StatusSelect
|
|
||||||
status={task.status}
|
|
||||||
taskTitle={task.title}
|
|
||||||
disabled={busy}
|
|
||||||
onChange={(status) => onStatusChange(task, status)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="task-cell due-date-cell" role="cell">
|
|
||||||
<DueDate value={task.due_date} />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="task-cell actions" role="cell">
|
|
||||||
<div className="task-actions">
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className="btn-action"
|
|
||||||
onClick={() => onEdit(task)}
|
|
||||||
disabled={busy}
|
|
||||||
aria-label={`Edit ${task.title}`}
|
|
||||||
>
|
|
||||||
<span aria-hidden="true">✎</span>
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className="btn-action delete"
|
|
||||||
onClick={() => onDelete(task)}
|
|
||||||
disabled={busy}
|
|
||||||
aria-label={`Delete ${task.title}`}
|
|
||||||
>
|
|
||||||
<span aria-hidden="true">🗑</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
|
|
||||||
export default TaskRow;
|
|
||||||
Loading…
Reference in New Issue
Block a user