Added createdAt to logs
This commit is contained in:
parent
81ee6ebd01
commit
fadf1f4176
1 changed files with 10 additions and 1 deletions
|
@ -18,6 +18,7 @@
|
|||
logged: boolean;
|
||||
type: string;
|
||||
pseudo?: string;
|
||||
createdAt: Date;
|
||||
};
|
||||
|
||||
const stateStore = createStateStore<Log>();
|
||||
|
@ -31,7 +32,10 @@
|
|||
(acc, log) => {
|
||||
const key = log.pseudo || 'Unknown';
|
||||
if (!acc[key]) acc[key] = [];
|
||||
acc[key].unshift(log);
|
||||
acc[key].unshift({
|
||||
...log,
|
||||
createdAt: new Date()
|
||||
});
|
||||
return acc;
|
||||
},
|
||||
{} as Record<string, Log[]>
|
||||
|
@ -104,6 +108,11 @@
|
|||
Pseudo: <span class="font-normal text-foreground">{log.pseudo}</span>
|
||||
</p>
|
||||
{/if}
|
||||
<p class="text-sm font-medium text-muted-foreground">
|
||||
Date:
|
||||
<span class="font-normal text-foreground">
|
||||
{log.createdAt.toLocaleString()}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
{/each}
|
||||
|
|
Loading…
Add table
Reference in a new issue