brutalism design

This commit is contained in:
2026-05-22 05:08:02 +06:00
parent abf4d41c23
commit e4ed785911
51 changed files with 940 additions and 1171 deletions

View File

@@ -1,5 +1,5 @@
import type { ChatMessage, ResponseError } from '@shared/api/generated-chad-api.ts'
import type { InfiniteData, QueryKey } from '@tanstack/vue-query'
import type { QueryKey } from '@tanstack/vue-query'
import api from '@shared/api/client.ts'
import { useInfiniteQuery } from '@tanstack/vue-query'
@@ -10,10 +10,10 @@ interface Response {
type PageParam = string | undefined
export function qChatMessages() {
return useInfiniteQuery<Response, ResponseError, InfiniteData<Response, PageParam>, QueryKey, PageParam>({
return useInfiniteQuery<Response, ResponseError, ChatMessage[], QueryKey, PageParam>({
queryKey: ['chat-messages'],
queryFn: async ({ pageParam }) => {
const response = await api.chad.chatMessages({ cursor: pageParam, limit: 30 })
const response = await api.chad.chatMessages({ cursor: pageParam, limit: 25 })
return response.data
// return {
@@ -25,6 +25,9 @@ export function qChatMessages() {
// pages: [...data.pages].reverse(),
// pageParams: [...data.pageParams].reverse(),
// }),
select: (data) => {
return data.pages.flatMap(page => page.messages).toReversed()
},
initialPageParam: undefined,
getNextPageParam: (lastPage) => {
return lastPage.nextCursor