diff --git a/components/FolderTag.tsx b/components/FolderTag.tsx
index 9745c83..33e91b4 100644
--- a/components/FolderTag.tsx
+++ b/components/FolderTag.tsx
@@ -1,22 +1,39 @@
-interface FolderData {
- id: number;
- createdAt: string;
- name: string;
- linkCount: number;
-}
+import { useRouter } from "next/router";
+import { FolderListData } from "@/types/folderTypes";
-const FolderTag = (list: FolderData[]) => {
- const folderStyle = "py-[8px] px-[12px] border border-purple-100 rounded-md";
+const FolderTag = ({ folderList }: FolderListData) => {
+ const router = useRouter();
+ const { folder: currentFolderId } = router.query;
+
+ const folderStyle =
+ "py-[8px] px-[12px] border border-purple100 rounded-md hover:bg-purple100 hover:text-white";
+
+ const handleSubmit = (id: number | string) => {
+ router.push({
+ pathname: router.pathname,
+ query: { ...router.query, folder: id },
+ });
+ };
return (
-
-
전체
- {list.map((folder) => (
-
- {folder.name}
-
+
+ -
+
+
+ {folderList.map((folder) => (
+ -
+
+
))}
-
+
);
};
diff --git a/components/Link/ActionButtons.tsx b/components/Link/ActionButtons.tsx
new file mode 100644
index 0000000..b498677
--- /dev/null
+++ b/components/Link/ActionButtons.tsx
@@ -0,0 +1,18 @@
+import Image from "next/image";
+
+const ActionButtons = () => (
+
+ {[
+ { src: "/icons/share.svg", alt: "공유", text: "공유" },
+ { src: "/icons/pen.svg", alt: "이름 변경", text: "이름 변경" },
+ { src: "/icons/delete.svg", alt: "삭제", text: "삭제" },
+ ].map(({ src, alt, text }) => (
+
+ ))}
+
+);
+
+export default ActionButtons;
diff --git a/components/Link/AddLinkInput.tsx b/components/Link/AddLinkInput.tsx
index 2c684fc..add6904 100644
--- a/components/Link/AddLinkInput.tsx
+++ b/components/Link/AddLinkInput.tsx
@@ -1,37 +1,40 @@
-import { ChangeEvent, FormEvent, useState } from "react";
-import { postLink } from "@/lib/api/link";
+import { ChangeEvent, KeyboardEvent, useState } from "react";
+import { FolderListData } from "@/types/folderTypes";
import Image from "next/image";
import SubmitButton from "../SubMitButton";
-const AddLinkInput = (folderId: number) => {
- const [value, setValue] = useState("");
+const AddLinkInput = ({ folderList }: FolderListData) => {
+ const [link, setLink] = useState("");
const handleChange = (e: ChangeEvent) => {
- setValue(e.target.value);
+ setLink(e.target.value);
};
- const handleSubmit = async (e: FormEvent) => {
- e.preventDefault();
- await postLink({ url: value, folderId });
- // postLink 하고 추가된 link가 보이도록 하는 로직 구현해야 함.
+ const handleClick = () => {
+ // Addmodal 띄우면서 link 전달
+ };
+
+ const handleKeyDown = (e: KeyboardEvent) => {
+ if (e.key === "Enter") {
+ e.preventDefault();
+ handleClick();
+ }
};
return (
-