diff options
Diffstat (limited to 'web/app/bookmarks/components/AddLink.tsx')
| -rw-r--r-- | web/app/bookmarks/components/AddLink.tsx | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/web/app/bookmarks/components/AddLink.tsx b/web/app/bookmarks/components/AddLink.tsx deleted file mode 100644 index fab4db8b..00000000 --- a/web/app/bookmarks/components/AddLink.tsx +++ /dev/null @@ -1,43 +0,0 @@ -"use client"; - -import { Button } from "@/components/ui/button"; -import { Input } from "@/components/ui/input"; -import APIClient from "@/lib/api"; -import { Plus } from "lucide-react"; -import { useRouter } from "next/navigation"; -import { useState } from "react"; - -export default function AddLink() { - const router = useRouter(); - const [link, setLink] = useState(""); - - const bookmarkLink = async () => { - const [_resp, error] = await APIClient.bookmarkLink(link); - if (error) { - // TODO: Proper error handling - alert(error.message); - return; - } - router.refresh(); - }; - - return ( - <div className="py-4 container flex w-full items-center space-x-2"> - <Input - type="text" - placeholder="Link" - value={link} - onChange={(val) => setLink(val.target.value)} - onKeyUp={async (event) => { - if (event.key == "Enter") { - bookmarkLink(); - setLink(""); - } - }} - /> - <Button onClick={bookmarkLink}> - <Plus /> - </Button> - </div> - ); -} |
