mirror of
https://gitlab.com/foxixus/neomovies.git
synced 2025-10-28 01:48:50 +05:00
- /src/api.ts - /src/lib/utils.ts - /src/lib/neoApi.ts - /src/lib/mongodb.ts - /src/lib/favoritesApi.ts - /src/lib/models/Favorite.ts - /src/hooks/useTMDBMovies.ts - /src/hooks/useImageLoader.ts - /src/hooks/useMovies.ts - /src/types/movie.ts - /src/components/SearchResults.tsx - /src/components/SettingsContent.tsx - /src/components/MovieCard.tsx - /src/components/FavoriteButton.tsx - /src/components/admin/MovieSearch.tsx - /src/app/page.tsx - /src/app/movie/[id]/page.tsx - /src/app/movie/[id]/MovieContent.tsx - /src/app/api/movies/upcoming/route.ts - /src/app/api/movies/search/route.ts - /src/app/api/movies/top-rated/route.ts - /src/app/api/movies/[id]/route.ts - /src/app/api/movies/popular/route.ts - /src/app/api/favorites/route.ts - /src/app/api/favorites/check/[mediaId]/route.ts - /src/app/api/favorites/[mediaId]/route.ts - /src/app/tv/[id]/TVShowContent.tsx - /src/app/tv/[id]/TVShowPage.tsx - /src/app/tv/[id]/page.tsx - /src/app/favorites/page.tsx - /src/configs/auth.ts - /next.config.js - /package.json - /README.md - /package-lock.json
26 lines
653 B
TypeScript
26 lines
653 B
TypeScript
import TVShowPage from './TVShowPage';
|
|
import { tvShowsAPI } from '@/lib/neoApi';
|
|
|
|
interface PageProps {
|
|
params: {
|
|
id: string;
|
|
};
|
|
searchParams: { [key: string]: string | string[] | undefined };
|
|
}
|
|
|
|
async function getData(id: string) {
|
|
try {
|
|
const response = await tvShowsAPI.getTVShow(id).then(res => res.data);
|
|
return { id, show: response };
|
|
} catch (error) {
|
|
console.error('Error fetching show:', error);
|
|
return { id, show: null };
|
|
}
|
|
}
|
|
|
|
export default async function Page(props: PageProps) {
|
|
const { id } = props.params;
|
|
const data = await getData(id);
|
|
return <TVShowPage tvShowId={data.id} show={data.show} />;
|
|
}
|