diff --git a/components/Link/AddLinkInput.tsx b/components/Link/AddLinkInput.tsx new file mode 100644 index 0000000..ca1ae83 --- /dev/null +++ b/components/Link/AddLinkInput.tsx @@ -0,0 +1,38 @@ +import { ChangeEvent, FormEvent, useState } from "react"; +import { postLink } from "@/lib/api/link"; +import Image from "next/image"; +import Button from "../Button"; + +const AddLinkInput = (folderId: number) => { + const [value, setValue] = useState(""); + + const handleChange = (e: ChangeEvent) => { + setValue(e.target.value); + }; + + const handleSubmit = async (e: FormEvent) => { + e.preventDefault(); + await postLink({ url: value, folderId }); + // postLink 하고 추가된 link가 보이도록 하는 로직 구현해야 함. + }; + + return ( +
+ link icon + + +
+ ); +}; + +export default AddLinkInput;