diff --git a/src/components/Home/InsightVideos.tsx b/src/components/Home/InsightVideos.tsx index 01d8ad4..5216b93 100644 --- a/src/components/Home/InsightVideos.tsx +++ b/src/components/Home/InsightVideos.tsx @@ -17,7 +17,7 @@ const InsightVideos: React.FC = ({ const [categoryItems] = useState([]); const [checkedItems, setCheckedItems] = useState([]); - const onFileClick = (e: React.MouseEvent) => { + const onFileClick = (e: React.MouseEvent) => { e.stopPropagation(); // 비디오 카테고리로 저장 API 호출 후 이런 인사이트는 어때요 API 재호출로 최신화하기 }; diff --git a/src/components/SummaryPage/SummaryDetailBox/CategorySelectBox/CategorySelectBox.tsx b/src/components/SummaryPage/SummaryDetailBox/CategorySelectBox/CategorySelectBox.tsx index fb577ff..36876d9 100644 --- a/src/components/SummaryPage/SummaryDetailBox/CategorySelectBox/CategorySelectBox.tsx +++ b/src/components/SummaryPage/SummaryDetailBox/CategorySelectBox/CategorySelectBox.tsx @@ -14,7 +14,7 @@ import { CategoryDropdown } from './CategoryDropdown'; type Props = { selectedCategoryId?: number; onSelect: (categoryId: number) => void; - onFileClick?: () => void; + onFileClick?: (e: React.MouseEvent) => void; }; const CategorySelectBox = ({ diff --git a/src/components/category/Card.tsx b/src/components/category/Card.tsx index 08a270c..571230c 100644 --- a/src/components/category/Card.tsx +++ b/src/components/category/Card.tsx @@ -1,17 +1,19 @@ import React, { useState } from 'react'; -import * as CardStyles from '@/styles/category/Card.style'; -import { IVideoProps } from 'types/videos'; -import { CategorySelectBox } from '../SummaryPage/SummaryDetailBox/CategorySelectBox'; -import { ISelectedCategoryProps } from 'types/category'; import { useRecoilValue } from 'recoil'; +import { IVideoProps } from 'types/videos'; + +import { CategorySelectBox } from '@/components/SummaryPage/SummaryDetailBox/CategorySelectBox'; + import { categoryState } from '@/stores/category'; +import * as CardStyles from '@/styles/category/Card.style'; + interface ICardProps { mode: 'default' | 'category' | 'recommend'; video: IVideoProps; checkedVideos?: number[]; setCheckedVideos?: (value: number[]) => void; - onFileClick?: (e: React.MouseEvent) => void; + onFileClick?: (e: React.MouseEvent) => void; } const Card: React.FC = ({ @@ -23,20 +25,12 @@ const Card: React.FC = ({ }) => { const [isOpen, setIsOpen] = useState(false); const category = useRecoilValue(categoryState); - const [selectedCategory, setSelectedCategory] = - useState({ - name: category[0].name, - categoryId: category[0].categoryId, - }); + const [selectedCategoryId, setSelectedCategoryId] = useState( + category[0].categoryId, + ); - const handleSelectCategory = ({ - name, - categoryId, - }: ISelectedCategoryProps) => { - setSelectedCategory({ - name, - categoryId, - }); + const handleSelectCategory = (categoryId: number) => { + setSelectedCategoryId(categoryId); }; const handleCheckBox = (videoId: number) => { @@ -77,8 +71,8 @@ const Card: React.FC = ({ {isOpen && mode === 'recommend' && (