INIT(app): initial commit
- Initialize project structure - Add base configuration
This commit is contained in:
24
services/nextjs/components/movie.tsx
Normal file
24
services/nextjs/components/movie.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
"use client";
|
||||
|
||||
import Link from "next/link";
|
||||
import styles from "../styles/movie.module.css";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
interface IMovieProps {
|
||||
title: string;
|
||||
id: string;
|
||||
poster_path: string;
|
||||
}
|
||||
|
||||
export default function Movie({ title, id, poster_path }: IMovieProps) {
|
||||
const router = useRouter();
|
||||
const onClick = () => {
|
||||
router.push(`/movies/${id}`);
|
||||
};
|
||||
return (
|
||||
<div className={styles.movie}>
|
||||
<img src={poster_path} alt={title} onClick={onClick} />
|
||||
<Link href={`/movies/${id}`}>{title}</Link>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user