mirror of
https://gitlab.com/foxixus/neomovies.git
synced 2025-10-28 09:58:49 +05:00
Update 103 files
- /public/file.svg - /public/globe.svg - /public/next.svg - /public/vercel.svg - /public/window.svg - /public/google.svg - /public/logo.png - /src/eslint.config.mjs - /src/api.ts - /src/middleware.ts - /src/app/favicon.ico - /src/app/globals.css - /src/app/layout.tsx - /src/app/page.tsx - /src/app/providers.tsx - /src/app/not-found.tsx - /src/app/error.tsx - /src/app/metadata.ts - /src/app/styles.tsx - /src/app/api/auth/[...nextauth]/route.ts - /src/app/api/auth/register/route.ts - /src/app/api/auth/verify/route.ts - /src/app/api/auth/check-verification/route.ts - /src/app/api/auth/resend-code/route.ts - /src/app/api/movies/search/route.ts - /src/app/api/movies/sync/route.ts - /src/app/api/admin/send-verification/route.ts - /src/app/api/admin/verify-code/route.ts - /src/app/api/admin/movies/route.ts - /src/app/api/admin/movies/toggle-visibility/route.ts - /src/app/api/admin/create/route.ts - /src/app/api/admin/users/toggle-admin/route.ts - /src/app/api/admin/toggle-admin/route.ts - /src/app/login/page.tsx - /src/app/login/LoginClient.tsx - /src/app/verify/page.tsx - /src/app/verify/VerificationClient.tsx - /src/app/profile/page.tsx - /src/app/movie/[id]/page.tsx - /src/app/movie/[id]/MoviePage.tsx - /src/app/movie/[id]/MovieContent.tsx - /src/app/settings/page.tsx - /src/app/tv/[id]/page.tsx - /src/app/tv/[id]/TVShowPage.tsx - /src/app/tv/[id]/TVShowContent.tsx - /src/app/admin/login/page.tsx - /src/app/admin/login/AdminLoginClient.tsx - /src/lib/db.ts - /src/lib/jwt.ts - /src/lib/registry.tsx - /src/lib/api.ts - /src/lib/mongodb.ts - /src/lib/mailer.ts - /src/lib/auth.ts - /src/lib/utils.ts - /src/lib/email.ts - /src/lib/movieSync.ts - /src/models/User.ts - /src/models/index.ts - /src/models/Movie.ts - /src/types/auth.ts - /src/types/movie.ts - /src/components/MovieCard.tsx - /src/components/Notification.tsx - /src/components/Pagination.tsx - /src/components/GoogleIcon.tsx - /src/components/StyleProvider.tsx - /src/components/Providers.tsx - /src/components/VerificationCodeInput.tsx - /src/components/GlassCard.tsx - /src/components/AppLayout.tsx - /src/components/SearchModal.tsx - /src/components/DarkReaderFix.tsx - /src/components/ClientLayout.tsx - /src/components/MenuItem.tsx - /src/components/MoviePlayer.tsx - /src/components/PageLayout.tsx - /src/components/SettingsContent.tsx - /src/components/Navbar.tsx - /src/components/LayoutContent.tsx - /src/components/SearchResults.tsx - /src/components/Icons/Icons.tsx - /src/components/Icons/HeartIcon.tsx - /src/components/Icons/PlayIcon.tsx - /src/components/admin/MovieSearch.tsx - /src/hooks/useUser.ts - /src/hooks/useMovies.ts - /src/hooks/useSettings.ts - /src/hooks/useSearch.ts - /src/styles/GlobalStyles.ts - /src/styles/GlobalStyles.tsx - /src/providers/AuthProvider.tsx - /src/data/movies.ts - /types/next-auth.d.ts - /middleware.ts - /next.config.js - /next-env.d.ts - /package.json - /postcss.config.mjs - /README.md - /tailwind.config.ts - /tsconfig.json - /package-lock.json
This commit is contained in:
216
src/app/tv/[id]/TVShowContent.tsx
Normal file
216
src/app/tv/[id]/TVShowContent.tsx
Normal file
@@ -0,0 +1,216 @@
|
||||
'use client';
|
||||
|
||||
import { useState } from 'react';
|
||||
import styled from 'styled-components';
|
||||
import Image from 'next/image';
|
||||
import type { TVShowDetails } from '@/lib/api';
|
||||
import MoviePlayer from '@/components/MoviePlayer';
|
||||
|
||||
const Container = styled.div`
|
||||
width: 100%;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
`;
|
||||
|
||||
const ShowInfo = styled.div`
|
||||
display: grid;
|
||||
grid-template-columns: 300px 1fr;
|
||||
gap: 2rem;
|
||||
margin-bottom: 2rem;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
`;
|
||||
|
||||
const PosterContainer = styled.div`
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 450px;
|
||||
border-radius: 0.5rem;
|
||||
overflow: hidden;
|
||||
`;
|
||||
|
||||
const InfoContent = styled.div`
|
||||
color: white;
|
||||
`;
|
||||
|
||||
const Title = styled.h1`
|
||||
font-size: 2.5rem;
|
||||
margin-bottom: 1rem;
|
||||
`;
|
||||
|
||||
const Overview = styled.p`
|
||||
margin-bottom: 1.5rem;
|
||||
line-height: 1.6;
|
||||
`;
|
||||
|
||||
const Stats = styled.div`
|
||||
display: flex;
|
||||
gap: 2rem;
|
||||
margin-bottom: 1.5rem;
|
||||
flex-wrap: wrap;
|
||||
`;
|
||||
|
||||
const StatItem = styled.div`
|
||||
span {
|
||||
color: rgba(255, 255, 255, 0.6);
|
||||
}
|
||||
`;
|
||||
|
||||
const Section = styled.section`
|
||||
margin-bottom: 2rem;
|
||||
`;
|
||||
|
||||
const SectionTitle = styled.h2`
|
||||
font-size: 1.5rem;
|
||||
margin-bottom: 1rem;
|
||||
color: white;
|
||||
padding-top: 1rem;
|
||||
`;
|
||||
|
||||
const PlayerSection = styled(Section)`
|
||||
margin-top: 2rem;
|
||||
min-height: 500px;
|
||||
`;
|
||||
|
||||
const PlayerContainer = styled.div`
|
||||
position: relative;
|
||||
width: 100%;
|
||||
aspect-ratio: 16/9;
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
border-radius: 0.5rem;
|
||||
overflow: hidden;
|
||||
`;
|
||||
|
||||
const CastGrid = styled.div`
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
|
||||
gap: 1rem;
|
||||
margin-top: 1rem;
|
||||
`;
|
||||
|
||||
const CastCard = styled.div`
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border-radius: 0.5rem;
|
||||
overflow: hidden;
|
||||
transition: transform 0.2s;
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
`;
|
||||
|
||||
const CastImageContainer = styled.div`
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 225px;
|
||||
`;
|
||||
|
||||
const CastInfo = styled.div`
|
||||
padding: 0.75rem;
|
||||
`;
|
||||
|
||||
const CastName = styled.h3`
|
||||
font-size: 0.9rem;
|
||||
margin-bottom: 0.25rem;
|
||||
color: white;
|
||||
`;
|
||||
|
||||
const Character = styled.p`
|
||||
font-size: 0.8rem;
|
||||
color: rgba(255, 255, 255, 0.6);
|
||||
`;
|
||||
|
||||
interface TVShowContentProps {
|
||||
tvShowId: string;
|
||||
initialShow: TVShowDetails;
|
||||
}
|
||||
|
||||
export default function TVShowContent({ tvShowId, initialShow }: TVShowContentProps) {
|
||||
const [show] = useState<TVShowDetails>(initialShow);
|
||||
|
||||
const formatDate = (date: string) => {
|
||||
return new Date(date).toLocaleDateString('ru-RU', {
|
||||
year: 'numeric',
|
||||
month: 'long',
|
||||
day: 'numeric',
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<Container>
|
||||
<ShowInfo>
|
||||
<PosterContainer>
|
||||
{show.poster_path && (
|
||||
<Image
|
||||
src={`https://image.tmdb.org/t/p/w500${show.poster_path}`}
|
||||
alt={show.name}
|
||||
fill
|
||||
style={{ objectFit: 'cover' }}
|
||||
priority
|
||||
/>
|
||||
)}
|
||||
</PosterContainer>
|
||||
|
||||
<InfoContent>
|
||||
<Title>{show.name}</Title>
|
||||
<Overview>{show.overview}</Overview>
|
||||
|
||||
<Stats>
|
||||
<StatItem>
|
||||
<span>Дата выхода: </span>
|
||||
{formatDate(show.first_air_date)}
|
||||
</StatItem>
|
||||
<StatItem>
|
||||
<span>Сезонов: </span>
|
||||
{show.number_of_seasons}
|
||||
</StatItem>
|
||||
<StatItem>
|
||||
<span>Эпизодов: </span>
|
||||
{show.number_of_episodes}
|
||||
</StatItem>
|
||||
</Stats>
|
||||
</InfoContent>
|
||||
</ShowInfo>
|
||||
|
||||
<PlayerSection>
|
||||
<SectionTitle>Смотреть онлайн</SectionTitle>
|
||||
<PlayerContainer>
|
||||
<MoviePlayer
|
||||
id={tvShowId}
|
||||
title={show.name}
|
||||
poster={show.poster_path ? `https://image.tmdb.org/t/p/w500${show.poster_path}` : ''}
|
||||
imdbId={show.external_ids?.imdb_id}
|
||||
/>
|
||||
</PlayerContainer>
|
||||
</PlayerSection>
|
||||
|
||||
{show.credits.cast.length > 0 && (
|
||||
<Section>
|
||||
<SectionTitle>В ролях</SectionTitle>
|
||||
<CastGrid>
|
||||
{show.credits.cast.slice(0, 12).map(actor => (
|
||||
<CastCard key={actor.id}>
|
||||
<CastImageContainer>
|
||||
<Image
|
||||
src={actor.profile_path
|
||||
? `https://image.tmdb.org/t/p/w300${actor.profile_path}`
|
||||
: '/placeholder.png'}
|
||||
alt={actor.name}
|
||||
fill
|
||||
style={{ objectFit: 'cover' }}
|
||||
/>
|
||||
</CastImageContainer>
|
||||
<CastInfo>
|
||||
<CastName>{actor.name}</CastName>
|
||||
<Character>{actor.character}</Character>
|
||||
</CastInfo>
|
||||
</CastCard>
|
||||
))}
|
||||
</CastGrid>
|
||||
</Section>
|
||||
)}
|
||||
</Container>
|
||||
);
|
||||
}
|
||||
37
src/app/tv/[id]/TVShowPage.tsx
Normal file
37
src/app/tv/[id]/TVShowPage.tsx
Normal file
@@ -0,0 +1,37 @@
|
||||
'use client';
|
||||
|
||||
import styled from 'styled-components';
|
||||
import PageLayout from '@/components/PageLayout';
|
||||
import TVShowContent from './TVShowContent';
|
||||
import type { TVShowDetails } from '@/lib/api';
|
||||
|
||||
const Container = styled.div`
|
||||
width: 100%;
|
||||
min-height: 100vh;
|
||||
padding: 0 24px;
|
||||
`;
|
||||
|
||||
interface TVShowPageProps {
|
||||
tvShowId: string;
|
||||
show: TVShowDetails | null;
|
||||
}
|
||||
|
||||
export default function TVShowPage({ tvShowId, show }: TVShowPageProps) {
|
||||
if (!show) {
|
||||
return (
|
||||
<PageLayout>
|
||||
<Container>
|
||||
<div>Сериал не найден</div>
|
||||
</Container>
|
||||
</PageLayout>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<PageLayout>
|
||||
<Container>
|
||||
<TVShowContent tvShowId={tvShowId} initialShow={show} />
|
||||
</Container>
|
||||
</PageLayout>
|
||||
);
|
||||
}
|
||||
25
src/app/tv/[id]/page.tsx
Normal file
25
src/app/tv/[id]/page.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
import TVShowPage from './TVShowPage';
|
||||
import { tvAPI } from '@/lib/api';
|
||||
|
||||
interface PageProps {
|
||||
params: {
|
||||
id: string;
|
||||
};
|
||||
searchParams: { [key: string]: string | string[] | undefined };
|
||||
}
|
||||
|
||||
async function getData(id: string) {
|
||||
try {
|
||||
const response = await tvAPI.getShow(id);
|
||||
return { id, show: response.data };
|
||||
} 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} />;
|
||||
}
|
||||
Reference in New Issue
Block a user