You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
900 B

  1. <script lang="ts">
  2. import type Project from "../models/project";
  3. import type { TaskResult } from "../models/task";
  4. import TaskEntry from "./TaskEntry.svelte";
  5. import projectStore from "../stores/project";
  6. export let project: Project;
  7. export let tasks: TaskResult[];
  8. export let showAllOptions: boolean;
  9. export let header: string;
  10. let sortedTasks: TaskResult[] = [];
  11. $: sortedTasks = tasks.sort((a,b) => a.createdTime.localeCompare(b.createdTime))
  12. </script>
  13. {#if tasks.length > 0}
  14. <h3>{header}</h3>
  15. {#each sortedTasks as task (task.id)}
  16. <TaskEntry
  17. showAllOptions={showAllOptions}
  18. task={task} project={project}
  19. actualProject={$projectStore.projects.find(p => p.id === task.projectId)}
  20. />
  21. {/each}
  22. {/if}
  23. <style>
  24. h3:empty {
  25. display: none;
  26. }
  27. h3 {
  28. padding: 0;
  29. margin: 0;
  30. margin-top: 0.5em;
  31. font-weight: 100;
  32. }
  33. </style>