-
Notifications
You must be signed in to change notification settings - Fork 114
/
Copy pathCardContent.tsx
52 lines (48 loc) · 1.36 KB
/
CardContent.tsx
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
import { KebabMenu } from "@components/folder/KebabMenu/KebabMenu";
import * as S from "./CardContentStyled";
import Image from "next/image";
import { usePortalContents } from "@hooks/usePortalContents";
import { FolderListDataForm } from "@data-access/getCategory";
interface CardContentProps {
elapsedTime: string;
description: string;
createdAt: string;
isHovered: boolean;
currentLocation: string;
selectURL: string;
folderList: FolderListDataForm[];
linkId: number;
}
export const CardContent = ({
elapsedTime,
description,
createdAt,
isHovered,
currentLocation,
selectURL,
folderList,
linkId,
}: CardContentProps) => {
const kebabMenu = usePortalContents();
return (
<S.CardContentContainer isHovered={isHovered}>
<>
<S.ElapsedTime>{elapsedTime}</S.ElapsedTime>
{!currentLocation.includes("shared") && (
<S.KebabButton type="button" onClick={kebabMenu.toggleContents}>
<Image fill src="/images/kebab.svg" alt="메뉴 보기" />
</S.KebabButton>
)}
{kebabMenu.isOpenModal && (
<KebabMenu
folderList={folderList}
selectURL={selectURL}
linkId={linkId}
/>
)}
</>
<S.Description>{description}</S.Description>
<S.CreatedAtText>{createdAt}</S.CreatedAtText>
</S.CardContentContainer>
);
};