From db6870a0bab73a591a3a7c809df2871d7923703e Mon Sep 17 00:00:00 2001 From: Baitinq Date: Wed, 10 Jul 2024 11:30:04 +0200 Subject: Misc: Add missing file --- src/components/Other/NoData.tsx | 9 +++++++++ src/pages/Recent.tsx | 12 ++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 src/components/Other/NoData.tsx diff --git a/src/components/Other/NoData.tsx b/src/components/Other/NoData.tsx new file mode 100644 index 0000000..c1236c1 --- /dev/null +++ b/src/components/Other/NoData.tsx @@ -0,0 +1,9 @@ +export default function NoData() { + return ( + <> +
+
No data
+
+ + ) +} diff --git a/src/pages/Recent.tsx b/src/pages/Recent.tsx index b0e0601..1578905 100644 --- a/src/pages/Recent.tsx +++ b/src/pages/Recent.tsx @@ -8,6 +8,8 @@ export default function Recent(props: any) { const [files, setFiles] = useState([]) + const [paginationOffset, setPaginationOffset] = useState(0); + useEffect(() => { if (!props.session) { navigate('/login') @@ -15,27 +17,33 @@ export default function Recent(props: any) { }, [props.session]) const fetchFiles = useCallback(async () => { + console.log("FETCHIN FILES") const { data, error } = await props.supabase .from('file') - .select() + .select().limit(10).offset(paginationOffset) if (error) { console.error(error) return } + console.log("FETCHED FILES") setFiles(data.map((file: any) => { return file as File })) }, [props.supabase]) useEffect(() => { + console.log("Aaa") fetchFiles() - }, []) + }, [paginationOffset]) return ( <>
+
{files.map((file: any) => (
-- cgit 1.4.1