Skip to content

Commit 254bb6d

Browse files
committed
Merge branch 'dev'
2 parents 261ae6a + b43b1b6 commit 254bb6d

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

apps/web/src/components/topic/content-list.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { useMemo, useState } from "react";
44
import Link from "next/link";
55

66
import { CONTENT_TYPE_OPTIONS, type ContentTypeOptions } from "@/constants/content";
7+
import { useDebounce } from "@/hooks/use-debounce";
78
import { useCreateContent } from "@/lib/tanstack/mutation/topic-content";
89
import { useGetAllContents } from "@/lib/tanstack/query/topic";
910
import { TopicNodeProps } from "@/types/topic";
@@ -33,6 +34,8 @@ export default function ContentList({
3334
}: ContentListProps) {
3435
const [searchQuery, setSearchQuery] = useState("");
3536

37+
const debouncedSearchQuery = useDebounce(searchQuery, 300);
38+
3639
const {
3740
data: contents,
3841
isLoading,
@@ -43,8 +46,13 @@ export default function ContentList({
4346
const { mutateAsync: createContent, isPending } = useCreateContent(id);
4447

4548
const filteredContents = useMemo(() => {
46-
return contents?.filter((content) => !nodes.some((node) => node.data.item.id === content.id));
47-
}, [contents, nodes]);
49+
const filteredBySearch = contents?.filter((content) =>
50+
content.title.toLowerCase().includes(debouncedSearchQuery.toLowerCase())
51+
);
52+
return filteredBySearch?.filter(
53+
(content) => !nodes.some((node) => node.data.item.id === content.id)
54+
);
55+
}, [contents, nodes, debouncedSearchQuery]);
4856

4957
const onSearchChange = (event: React.ChangeEvent<HTMLInputElement>) => {
5058
setSearchQuery(event.target.value);

apps/web/src/components/topic/custom-node.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ export default function CustomNode(props: CustomNodeProps) {
144144
minHeight={220}
145145
lineClassName="opacity-0"
146146
handleClassName="opacity-0"
147+
lineStyle={{ borderWidth: "10px" }}
148+
handleStyle={{ borderWidth: "10px" }}
147149
/>
148150

149151
{/* Source Handles - 연결 시작점 */}

apps/web/src/components/topic/user-sticker.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export default function UserSticker({ item, topicId }: { item: TopicDTO; topicId
6161
<h2 className="mb-3 line-clamp-1 text-2xl leading-tight font-bold text-gray-800">
6262
{item.title}
6363
</h2>
64-
<div className="prose" dangerouslySetInnerHTML={{ __html: renderContent(item.content) }} />
64+
<div dangerouslySetInnerHTML={{ __html: renderContent(item.content) }} />
6565
</div>
6666
</div>
6767
);

0 commit comments

Comments
 (0)