- src/pages/index.tsx +4 -2
src/pages/index.tsx
CHANGED
@@ -7,8 +7,8 @@ import { HF_FileEntry, HFRes } from "@/types";
|
|
7 |
import { basename } from "path";
|
8 |
|
9 |
export default function Home() {
|
10 |
-
const [repo, setRepo] = useState('https://huggingface.co/datasets/banned-historical-archives/
|
11 |
-
const [path, setPath] = useState('
|
12 |
const [entries, setEntries] = useState<HF_FileEntry[]>([])
|
13 |
const [next, setNext] = useState('')
|
14 |
const update = useCallback(
|
@@ -49,6 +49,8 @@ export default function Home() {
|
|
49 |
const res = await fetch('https://huggingface.co' + next);
|
50 |
if (res.headers.get('link')) {
|
51 |
setNext(res.headers.get('link')!.split('>;')[0].replace('<https://huggingface.co', ''))
|
|
|
|
|
52 |
}
|
53 |
const data = await (res).json() as HF_FileEntry[];
|
54 |
setEntries([...entries, ...data]);
|
|
|
7 |
import { basename } from "path";
|
8 |
|
9 |
export default function Home() {
|
10 |
+
const [repo, setRepo] = useState('https://huggingface.co/datasets/banned-historical-archives/banned-historical-archives/tree/main');
|
11 |
+
const [path, setPath] = useState('');
|
12 |
const [entries, setEntries] = useState<HF_FileEntry[]>([])
|
13 |
const [next, setNext] = useState('')
|
14 |
const update = useCallback(
|
|
|
49 |
const res = await fetch('https://huggingface.co' + next);
|
50 |
if (res.headers.get('link')) {
|
51 |
setNext(res.headers.get('link')!.split('>;')[0].replace('<https://huggingface.co', ''))
|
52 |
+
} else {
|
53 |
+
setNext('');
|
54 |
}
|
55 |
const data = await (res).json() as HF_FileEntry[];
|
56 |
setEntries([...entries, ...data]);
|