diff options
Diffstat (limited to 'src/pages/Recent.tsx')
-rw-r--r-- | src/pages/Recent.tsx | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/src/pages/Recent.tsx b/src/pages/Recent.tsx index 19c681f..76d9e2a 100644 --- a/src/pages/Recent.tsx +++ b/src/pages/Recent.tsx @@ -23,7 +23,6 @@ export default function Recent(props: any) { const { data, error } = await props.supabase .from('file') .select().range(paginationOffset, paginationOffset + numOfFilesToShow - 1) - //.limit(10).offset(paginationOffset) if (error) { console.error(error) return @@ -44,17 +43,24 @@ export default function Recent(props: any) { <> <div className="flex h-screen"> <SideBar currentPage="Recent" /> - <main className="flex-1 overflow-y-auto"> - <button onClick={() => setPaginationOffset(paginationOffset + numOfFilesToShow)}> - clickmeforpaginate - </button> - <div> - {files.map((file: any) => ( - <div key={file.id}> - <p className="underline">file: {file.absolute_path}</p> - </div> - )) - } + <main className="flex-1 overflow-y-auto my-4"> + <div className="flex flex-col items-center"> + <div className="flex flex-col gap-2"> + {files.map((file: any) => ( + <div key={file.id} role="button" onClick={() => console.log("clocked file")}> + <p className="underline">file: {file.absolute_path}</p> + </div> + )) + } + </div> + </div> + <div className="flex flex-row gap-2 mt-4"> + <button className="ml-7 bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded" onClick={() => setPaginationOffset(paginationOffset + -numOfFilesToShow)}> + prev + </button> + <button className="mr-7 ml-auto bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded" onClick={() => setPaginationOffset(paginationOffset + numOfFilesToShow)}> + next + </button> </div> </main> </div> |