| Name | Message | Date |
|---|---|---|
| 📄 GpsDialog.svelte | 1 month ago | |
| 📄 HistoryEntry.svelte | 1 month ago | |
| 📄 PatchBanner.svelte | 1 month ago |
📄
src/lib/components/HistoryEntry.svelte
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<script lang="ts">
import type { HistoryEntry } from "$lib/types";
let { entry, name }: { entry: HistoryEntry; name?: string } = $props();
function formatDate(iso: string): string {
return new Date(iso).toLocaleDateString(undefined, {
month: "short",
day: "numeric",
year: "numeric",
});
}
function formatTime(iso: string): string {
return new Date(iso).toLocaleTimeString(undefined, {
hour: "2-digit",
minute: "2-digit",
});
}
</script>
<li class:has-name={!!name}>
{#if name}
<span class="name">{name}</span>
{/if}
<div class="meta">
<span class="confidence">{(entry.confidence * 100).toFixed(0)}%</span>
<span class="when">
<span>{formatDate(entry.detectedAt)}</span>
<span>{formatTime(entry.detectedAt)}</span>
</span>
</div>
</li>
<style>
li {
background: var(--bg-paper);
border: 2px solid var(--bg-near-black);
border-radius: 8px;
padding: 0.75rem 1rem;
position: relative;
display: flex;
justify-content: flex-end;
align-items: center;
&.has-name {
justify-content: space-between;
}
&::before {
content: "";
position: absolute;
inset: 5px;
border-radius: 4px;
border: 1.5px dashed var(--accent-amber);
pointer-events: none;
}
.name {
font-weight: 700;
}
.meta {
display: flex;
flex-direction: column;
align-items: flex-end;
gap: 0.2rem;
}
.confidence {
color: var(--brand-red);
font-weight: 600;
font-variant-numeric: tabular-nums;
font-size: 0.9rem;
}
.when {
display: flex;
flex-direction: column;
align-items: flex-end;
gap: 0.05rem;
font-variant-numeric: tabular-nums;
font-size: 0.8rem;
opacity: 0.6;
}
}
</style>