From f9febea780a0688a4467f809b4564a8ac9897e96 Mon Sep 17 00:00:00 2001 From: parap Date: Mon, 1 May 2023 01:24:56 +0400 Subject: [PATCH] dop catalog --- .../src/components/catalogs/CatalogActors.jsx | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 frontend/src/components/catalogs/CatalogActors.jsx diff --git a/frontend/src/components/catalogs/CatalogActors.jsx b/frontend/src/components/catalogs/CatalogActors.jsx new file mode 100644 index 0000000..6cc0434 --- /dev/null +++ b/frontend/src/components/catalogs/CatalogActors.jsx @@ -0,0 +1,51 @@ +import Catalog from "../common/Catalog"; +import { useEffect, useState } from "react"; + +import DataService from "../../services/DataService"; + +let headers = [ + {label: "name", text: "Имя"}, + {label: "surname", text: "Фамилия"} +] + +export default function CatalogActors() { + const url = "/actors"; + + const [data, setData] = useState({ + name: "", + surname: "" + }); + + const [actors, setActors] = useState([]); + + function handleFormChange(e) { + setData({ ...data, [e.target.id]: e.target.value }) + } + + function onAdd() { + setData({name: "", genre: actors[0]}); + } + + + function onChange(data) { + setData(data); + } + + function validate(data) { + if(data.name === "") return false; + return true; + } + + return ( + +
+ + + + +
+
+ ) +} \ No newline at end of file