export function groupByCreatedAt<T extends { createdAt: Date }>(items: T[]) {
  return Object.entries(
    items.reduce((acc, session) => {
      const date = session.createdAt.toString().split("T")[0];
      acc[date] = acc[date] || [];
      acc[date].push(session);
      return acc;
    }, {} as Record<string, T[]>)
  );
}
