@@ -2,7 +2,6 @@ import { API_URL } from '@/env'
22import { useGoBack } from '@/hooks/useGoBack'
33import { useMutation , useQuery , useQueryClient } from '@tanstack/react-query'
44import { TMemory } from '../types'
5- import Layout from './Layout'
65import Memory from './Memory'
76import Spinner from './Spinner'
87
@@ -74,21 +73,19 @@ const Memories = () => {
7473 useGoBack ( )
7574
7675 return (
77- < Layout >
78- < div className = "z-1 flex w-full flex-col items-center justify-between gap-2.5 rounded-xl border border-(--color-opposite-text) p-2.5 backdrop-blur-3xl backdrop-opacity-80 dark:border-(--color-main-text)/30" >
79- < div className = "my-1.5 flex w-full items-center justify-between" >
80- < h1 className = "text-center text-2xl font-bold" > { `Memories (${ memories ?. total ?? '-' } )` } </ h1 >
81- < button
82- className = "flex w-16 cursor-pointer items-center justify-center py-1.5 text-(--color-gray-text) transition hover:not-disabled:text-(--color-main-text) hover:disabled:cursor-default"
83- onClick = { ( ) => handleDeleteAll . mutate ( ) }
84- disabled = { ! memories || ! memories . total }
85- >
86- { handleDeleteAll . isPending ? < Spinner /> : 'Clear all' }
87- </ button >
88- </ div >
89- { memories ?. items . map ( ( memory ) => < Memory key = { memory . data } memory = { memory } /> ) }
76+ < div className = "z-1 flex w-full flex-col items-center justify-between gap-2.5 rounded-xl border border-(--color-opposite-text) p-2.5 backdrop-blur-3xl backdrop-opacity-80 dark:border-(--color-main-text)/30" >
77+ < div className = "my-1.5 flex w-full items-center justify-between" >
78+ < h1 className = "text-center text-2xl font-bold" > { `Memories (${ memories ?. total ?? '-' } )` } </ h1 >
79+ < button
80+ className = "flex w-16 cursor-pointer items-center justify-center py-1.5 text-(--color-gray-text) transition hover:not-disabled:text-(--color-main-text) hover:disabled:cursor-default"
81+ onClick = { ( ) => handleDeleteAll . mutate ( ) }
82+ disabled = { ! memories || ! memories . total }
83+ >
84+ { handleDeleteAll . isPending ? < Spinner /> : 'Clear all' }
85+ </ button >
9086 </ div >
91- </ Layout >
87+ { memories ?. items . map ( ( memory ) => < Memory key = { memory . data } memory = { memory } /> ) }
88+ </ div >
9289 )
9390}
9491
0 commit comments