feat: rework ux for deleting chats (#46)

This commit is contained in:
Dominic Elm
2024-08-21 07:58:43 +02:00
committed by GitHub
parent fcfef742d5
commit 1e11ab6395
10 changed files with 307 additions and 57 deletions

View File

@@ -1,9 +1,9 @@
import { format, isAfter, isThisWeek, isThisYear, isToday, isYesterday, subDays } from 'date-fns';
import type { ChatHistory } from '~/lib/persistence';
import type { ChatHistoryItem } from '~/lib/persistence';
type Bin = { category: string; items: ChatHistory[] };
type Bin = { category: string; items: ChatHistoryItem[] };
export function binDates(_list: ChatHistory[]) {
export function binDates(_list: ChatHistoryItem[]) {
const list = _list.toSorted((a, b) => Date.parse(b.timestamp) - Date.parse(a.timestamp));
const binLookup: Record<string, Bin> = {};