feat: swiper
This commit is contained in:
1 parent
cd8928ab54
commit
12223b79d5
20 files changed
+222
-164
No files matched your search
@@ -1,38 +1,29 @@
|
||||
import { FC, ReactNode } from 'react';
|
||||
import { FC } from 'react';
|
||||
import { ImageOff } from 'lucide-react';
|
||||
import Image from 'next/image';
|
||||
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
interface Props {
|
||||
title: string;
|
||||
poster: string;
|
||||
width: number;
|
||||
height: number;
|
||||
size: number;
|
||||
className?: string;
|
||||
children?: ReactNode;
|
||||
}
|
||||
|
||||
const Poster: FC<Props> = ({ title, poster, width, height, size = 250, className, children }) => {
|
||||
return (
|
||||
<div
|
||||
className={`w-full flex flex-col rounded-lg overflow-hidden shrink-0 lg:m-0 mx-auto relative ${className}`}
|
||||
style={{ minHeight: poster ? '' : height }}
|
||||
>
|
||||
{poster ? (
|
||||
<Image
|
||||
className='rounded-lg mx-auto w-auto'
|
||||
unoptimized
|
||||
height={height}
|
||||
width={width}
|
||||
src={`https://image.tmdb.org/t/p/w500/${poster}`}
|
||||
alt={title}
|
||||
/>
|
||||
) : (
|
||||
<div className={`h-[${height}px] w-full flex items-center justify-center rounded-lg border grow`}>
|
||||
<ImageOff size={size} strokeWidth={1} />
|
||||
</div>
|
||||
)}
|
||||
{children}
|
||||
const Poster: FC<Props> = ({ title, poster, size = 250, className }) => {
|
||||
return poster ? (
|
||||
<Image
|
||||
className={cn('rounded-lg mx-auto w-auto h-full object-fill', className)}
|
||||
unoptimized
|
||||
height={750}
|
||||
width={500}
|
||||
src={`https://image.tmdb.org/t/p/w500/${poster}`}
|
||||
alt={title}
|
||||
/>
|
||||
) : (
|
||||
<div className={'w-full flex items-center justify-center rounded-lg grow'}>
|
||||
<ImageOff size={size} strokeWidth={1} color='hsl(215.4 16.3% 46.9%)' />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user