diff --git a/bun.lockb b/bun.lockb index 0661eb3..56658e6 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index afc3877..893537b 100644 --- a/package.json +++ b/package.json @@ -1,27 +1,27 @@ { - "name": "trepa-web", - "type": "module", - "version": "0.0.1", - "scripts": { - "dev": "bunx --bun astro dev", - "build": "rm -rf dist && bunx --bun astro check && bunx --bun astro build", - "preview": "bunx --bun astro preview", - "astro": "astro" - }, - "dependencies": { - "@astrojs/check": "^0.7.0", - "@astrojs/node": "^8.3.2", - "@astrojs/react": "^3.6.0", - "@types/react": "^18.3.3", - "@types/react-dom": "^18.3.0", - "astro": "^4.11.3", - "bootstrap": "^5.3.3", - "react": "^18.3.1", - "react-dom": "^18.3.1", - "react-icons": "^5.2.1", - "typescript": "^5.5.2" - }, - "devDependencies": { - "@biomejs/biome": "1.8.3" - } + "name": "trepa-web", + "type": "module", + "version": "0.0.1", + "scripts": { + "dev": "bunx --bun astro dev", + "build": "rm -rf dist && bunx --bun astro check && bunx --bun astro build", + "preview": "bunx --bun astro preview", + "astro": "astro" + }, + "dependencies": { + "@astrojs/check": "^0.8.0", + "@astrojs/node": "^8.3.2", + "@astrojs/react": "^3.6.0", + "@types/react": "^18.3.3", + "@types/react-dom": "^18.3.0", + "astro": "^4.11.5", + "bootstrap": "^5.3.3", + "react": "^18.3.1", + "react-dom": "^18.3.1", + "react-icons": "^5.2.1", + "typescript": "^5.5.3" + }, + "devDependencies": { + "@biomejs/biome": "1.8.3" + } } diff --git a/src/components/TmdbSearch.tsx b/src/components/TmdbSearch.tsx index b7f9b01..1771ac7 100644 --- a/src/components/TmdbSearch.tsx +++ b/src/components/TmdbSearch.tsx @@ -3,7 +3,11 @@ import type { Movie } from "../types"; import TmdbSearchInput from "./TmdbSearchInput"; import GroupMoviesList from "./lists/movies/GroupMoviesList"; -export default function TmdbSearch() { +interface TmdbSearchProps { + onSearch: (movie: Movie) => void; +} + +export default function TmdbSearch({ onSearch }: TmdbSearchProps) { const [movies, setMovies] = useState([]); function handleOnSearch(movies: Movie[]) { @@ -19,7 +23,7 @@ export default function TmdbSearch() {
- +
diff --git a/src/components/forms/AddMovieForm.tsx b/src/components/forms/AddMovieForm.tsx new file mode 100644 index 0000000..eb05a90 --- /dev/null +++ b/src/components/forms/AddMovieForm.tsx @@ -0,0 +1,34 @@ +import { useState } from "react"; +import TmdbSearch from "../TmdbSearch"; +import type { CreateMovie, Movie } from "../../types"; +import MovieFormData from "./MovieFormData"; + +export default function AddMovieForm() { + const [tmdbMovie, setTmdbMovie] = useState(null); + + function handleOnSearch(movie: Movie) { + setTmdbMovie(movie); + } + + const createMovie: CreateMovie | undefined = tmdbMovie + ? { + title: tmdbMovie.title, + backdrop_path: tmdbMovie.backdrop_path, + poster_path: tmdbMovie.poster_path, + overview: tmdbMovie.overview, + release_date: tmdbMovie.release_date, + tmdb_id: tmdbMovie.id, + } + : undefined; + + return ( +
+
+ +
+
+ +
+
+ ); +} diff --git a/src/components/forms/LoginForm.tsx b/src/components/forms/LoginForm.tsx index b2283f0..9c700a9 100644 --- a/src/components/forms/LoginForm.tsx +++ b/src/components/forms/LoginForm.tsx @@ -7,6 +7,7 @@ export interface LoginFormValue { interface LoginFormProps { onSubmit: (data: LoginFormValue) => void; + disabled?: boolean; } export default function LoginForm(props: LoginFormProps) { @@ -60,6 +61,7 @@ export default function LoginForm(props: LoginFormProps) {