|
|
@ -1,3 +1,7 @@ |
|
|
|
<script lang="ts" context="module"> |
|
|
|
export type ItemSubSectionEvent = "created" | "scheduled" | "acquired" | "none" |
|
|
|
</script> |
|
|
|
|
|
|
|
<script lang="ts"> |
|
|
|
import Markdown from "$lib/components/common/Markdown.svelte"; |
|
|
|
import SubSection from "$lib/components/layout/SubSection.svelte"; |
|
|
@ -9,12 +13,15 @@ |
|
|
|
import AmountRow from "../common/AmountRow.svelte"; |
|
|
|
import type { IconName } from "../layout/Icon.svelte"; |
|
|
|
import Icon from "../layout/Icon.svelte"; |
|
|
|
import { formatTime } from "$lib/utils/date"; |
|
|
|
import { formatDays, formatPrettyTime, formatTime } from "$lib/utils/date"; |
|
|
|
import RequirementReference from "./RequirementReference.svelte"; |
|
|
|
import ItemTimeInfo from "./ItemTimeInfo.svelte"; |
|
|
|
import { getTimeContext } from "../contexts/TimeContext.svelte"; |
|
|
|
|
|
|
|
const {now} = getTimeContext(); |
|
|
|
|
|
|
|
export let item: Item; |
|
|
|
export let event: "created" | "scheduled" | "acquired" | "none" = "none"; |
|
|
|
export let event: ItemSubSectionEvent = "none"; |
|
|
|
export let compact = false; |
|
|
|
export let showAcquiredTime = false; |
|
|
|
export let hideStats = false; |
|
|
@ -34,9 +41,9 @@ |
|
|
|
} |
|
|
|
} else if (event === "scheduled") { |
|
|
|
if (!item.acquiredTime) { |
|
|
|
icon = "hourglass"; |
|
|
|
icon = "calendar"; |
|
|
|
status = Status.Blocked; |
|
|
|
eventText = "scheduled" |
|
|
|
eventText = formatDays(new Date(item.scheduledDate), $now) |
|
|
|
} |
|
|
|
} else if (event === "created") { |
|
|
|
icon = "lightbulb"; |
|
|
|