project map script | semantic parcer
This commit is contained in:
@@ -15,6 +15,8 @@
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
// [DEF:getStatusColor:Function]
|
||||
// @PURPOSE: Returns the CSS color class for a given task status.
|
||||
function getStatusColor(status: string) {
|
||||
switch (status) {
|
||||
case 'SUCCESS': return 'bg-green-100 text-green-800';
|
||||
@@ -26,7 +28,10 @@
|
||||
default: return 'bg-gray-100 text-gray-800';
|
||||
}
|
||||
}
|
||||
// [/DEF:getStatusColor:Function]
|
||||
|
||||
// [DEF:formatTime:Function]
|
||||
// @PURPOSE: Formats a date string using date-fns.
|
||||
function formatTime(dateStr: string | null) {
|
||||
if (!dateStr) return 'N/A';
|
||||
try {
|
||||
@@ -35,10 +40,14 @@
|
||||
return 'Invalid date';
|
||||
}
|
||||
}
|
||||
// [/DEF:formatTime:Function]
|
||||
|
||||
// [DEF:handleTaskClick:Function]
|
||||
// @PURPOSE: Dispatches a select event when a task is clicked.
|
||||
function handleTaskClick(taskId: string) {
|
||||
dispatch('select', { id: taskId });
|
||||
}
|
||||
// [/DEF:handleTaskClick:Function]
|
||||
</script>
|
||||
|
||||
<div class="bg-white shadow overflow-hidden sm:rounded-md">
|
||||
@@ -91,4 +100,4 @@
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<!-- [/DEF:TaskList] -->
|
||||
<!-- [/DEF:TaskList:Component] -->
|
||||
Reference in New Issue
Block a user