MCPcopy
hub / github.com/codeaashu/claude-code / TaskItem

Function TaskItem

src/components/TaskListV2.tsx:242–371  ·  view source on GitHub ↗
(t0)

Source from the content-addressed store, hash-verified

240 }
241}
242function TaskItem(t0) {
243 const $ = _c(37);
244 const {
245 task,
246 ownerColor,
247 openBlockers,
248 activity,
249 ownerActive,
250 columns
251 } = t0;
252 const isCompleted = task.status === "completed";
253 const isInProgress = task.status === "in_progress";
254 const isBlocked = openBlockers.length > 0;
255 let t1;
256 if ($[0] !== task.status) {
257 t1 = getTaskIcon(task.status);
258 $[0] = task.status;
259 $[1] = t1;
260 } else {
261 t1 = $[1];
262 }
263 const {
264 icon,
265 color
266 } = t1;
267 const showActivity = isInProgress && !isBlocked && activity;
268 const showOwner = columns >= 60 && task.owner && ownerActive;
269 let t2;
270 if ($[2] !== showOwner || $[3] !== task.owner) {
271 t2 = showOwner ? stringWidth(` (@${task.owner})`) : 0;
272 $[2] = showOwner;
273 $[3] = task.owner;
274 $[4] = t2;
275 } else {
276 t2 = $[4];
277 }
278 const ownerWidth = t2;
279 const maxSubjectWidth = Math.max(15, columns - 15 - ownerWidth);
280 let t3;
281 if ($[5] !== maxSubjectWidth || $[6] !== task.subject) {
282 t3 = truncateToWidth(task.subject, maxSubjectWidth);
283 $[5] = maxSubjectWidth;
284 $[6] = task.subject;
285 $[7] = t3;
286 } else {
287 t3 = $[7];
288 }
289 const displaySubject = t3;
290 const maxActivityWidth = Math.max(15, columns - 15);
291 let t4;
292 if ($[8] !== activity || $[9] !== maxActivityWidth) {
293 t4 = activity ? truncateToWidth(activity, maxActivityWidth) : undefined;
294 $[8] = activity;
295 $[9] = maxActivityWidth;
296 $[10] = t4;
297 } else {
298 t4 = $[10];
299 }

Callers

nothing calls this directly

Calls 3

getTaskIconFunction · 0.85
truncateToWidthFunction · 0.85
maxMethod · 0.80

Tested by

no test coverage detected