-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathindex.tsx
60 lines (52 loc) · 1.27 KB
/
index.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
53
54
55
56
57
58
59
60
import { Avatar, Card, Skeleton, Space, Tag, Typography,Col } from "antd";
import style from "./Resource.module.scss";
import { ListItemProps } from "components/ComponentInjector";
const { Title } = Typography;
type SocialName = "github" | "youtube" | "website";
interface Social {
name: SocialName;
url: string;
}
export interface ResourceType {
name: string;
category: string;
subCategory: string[];
socials: Social[];
url: string;
}
const Resource: React.FC<ListItemProps<ResourceType>> = ({
resource,
handleOnClick,
isLoading,
}) => {
const { name, category, url } = resource || {};
return (
<Col className="gutter-row" xs={24} md={12} xl={8}>
<Card
className={style.resource}
key={name}
onClick={() => handleOnClick(url)}
hoverable
>
<Skeleton loading={isLoading} avatar active>
<Space className={style.resource__container}>
<Space size={16}>
<Avatar className={style.resource__avatar}>
{name?.[0]}
</Avatar>
<Space direction="vertical">
<Title level={4}>{name}</Title>
<Tag key={category}>{category}</Tag>
</Space>
</Space>
{/* <Clipboard
text={url}
clipboardComponent={ClipboardButton}
/> */}
</Space>
</Skeleton>
</Card>
</Col>
);
};
export default Resource;