-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMyBookmarkCard.tsx
More file actions
67 lines (60 loc) · 1.86 KB
/
MyBookmarkCard.tsx
File metadata and controls
67 lines (60 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import chippiNoImage from '../../assets/chippi_no_image.svg';
import { Icon } from '../../icons';
import BaseCard from './BaseCard';
interface MyBookmarkCardProps {
title: string;
content?: string;
category?: string;
imageUrl?: string;
date: string;
onClick?: () => void;
onOptionsClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
}
const MyBookmarkCard = ({
title,
content,
category,
imageUrl,
date,
onOptionsClick,
}: MyBookmarkCardProps) => {
return (
<BaseCard>
<div className="flex h-[12rem] w-full items-center justify-center overflow-hidden bg-[#F8F8FA]">
{imageUrl ? (
<img src={imageUrl} className="h-full w-full object-cover" />
) : (
<img
src={chippiNoImage}
alt="이미지 없을 경우 logo"
className="h-[12rem]"
/>
)}
</div>
<div className="px-[1.6rem] py-[2.4rem]">
<div className="mb-[0.8rem] flex h-[5.6rem] justify-between gap-[0.8rem]">
<h3 className="head6 line-clamp-2">{title}</h3>
<button
type="button"
aria-label="카테고리 상세"
className="cursor-pointer self-start"
onClick={(e) => onOptionsClick?.(e)}
>
<Icon name="ic_details_category" />
</button>
</div>
<p className="body3-r text-font-gray-2 mb-[1.2rem] line-clamp-2 h-[4.2rem]">
{content}
</p>
{/* TODO: 카테고리 컴포넌트로 교체 */}
{category && (
<span className="bg-category-red-bg caption2-sb text-category-red-text h-[2.2rem] w-[6.2rem] rounded-[0.4rem] px-[0.8rem] py-[0.2rem]">
{category}
</span>
)}
<p className="caption2-m text-font-ltgray-4 mt-[1.2rem]">{date}</p>
</div>
</BaseCard>
);
};
export default MyBookmarkCard;