Spaces:
Sleeping
Sleeping
Download src/components/DeferredSection.astro from TXAVLOG/dptxa-proxy: direct link, hf CLI and curl.
- Browser
- Download file 740 Bytes
-
https://huggingface.co/spaces/TXAVLOG/dptxa-proxy/resolve/main/src/components/DeferredSection.astro
- Command line
-
hf download hf://spaces/TXAVLOG/dptxa-proxy/src/components/DeferredSection.astro
-
curl -L -o DeferredSection.astro https://huggingface.co/spaces/TXAVLOG/dptxa-proxy/resolve/main/src/components/DeferredSection.astro
740 Bytes
| --- | |
| import MovieSection from './MovieSection.jsx'; | |
| import { getNewestMovies, getSeriesMovies, getSingleMovies, getCartoonMovies } from '../lib/api.js'; | |
| interface Props { | |
| type: 'newest' | 'series' | 'single' | 'cartoon'; | |
| title: string; | |
| href: string; | |
| } | |
| const { type, title, href } = Astro.props; | |
| let movies = []; | |
| try { | |
| if (type === 'newest') movies = (await getNewestMovies(1))?.items || []; | |
| if (type === 'series') movies = (await getSeriesMovies(1))?.items || []; | |
| if (type === 'single') movies = (await getSingleMovies(1))?.items || []; | |
| if (type === 'cartoon') movies = (await getCartoonMovies(1))?.items || []; | |
| } catch (e) { | |
| console.error(e); | |
| } | |
| --- | |
| <MovieSection title={title} movies={movies} href={href} client:load /> | |