feat: integrate database operations for movie management in global store and UI components; enhance MovieCast with dynamic cast display and button for full cast visibility

This commit is contained in:
Norbert Maciaszek
2025-08-18 00:24:08 +02:00
parent 5a6ee42e28
commit 7a7bc2575b
5 changed files with 40 additions and 20 deletions

View File

@@ -10,8 +10,6 @@ import {
} from "react-icons/fa";
import { RiCalendarCheckLine, RiCalendarScheduleLine } from "react-icons/ri";
import { useGlobalStore } from "@/app/store/globalStore";
import { addMovie, deleteMovie } from "@/lib/db";
import { ReadMore } from "@/components/atoms/ReadMore";
import Link from "next/link";
import { Button } from "@/components/atoms/Button";
@@ -95,12 +93,10 @@ export const Hero: FC<Props> = ({
}, [autoRotate, rotateInterval, nextSlide, movies.length]);
const handleAdd = async () => {
await addMovie(currentMovie);
addMovieToStore(currentMovie);
};
const handleRemove = async () => {
await deleteMovie(id);
deleteMovieInStore(id);
};