-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathIssueModule.tsx
More file actions
40 lines (37 loc) · 1.16 KB
/
IssueModule.tsx
File metadata and controls
40 lines (37 loc) · 1.16 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
import { text2color } from 'idea-react';
import type { GitRepository } from 'mobx-github';
import { FC } from 'react';
import { Accordion, Badge, Col, Row } from 'react-bootstrap';
import { IssueCard } from './Card';
export const IssueModule: FC<GitRepository> = ({ name, language, issues }) => (
<Accordion.Item eventKey={name}>
<Accordion.Header>
<Row className="flex-fill align-items-center gx-3">
<Col xs={4} sm={2}>
{language && (
<Badge className="fs-6" bg={text2color(language, ['light'])}>
{language}
</Badge>
)}
</Col>
<Col xs={6} sm={8} as="h3" className="m-0 text-truncate">
{name}
</Col>
<Col xs={2} className="text-end">
<Badge className="fs-6" pill bg="info">
{issues?.length}
</Badge>
</Col>
</Row>
</Accordion.Header>
<Accordion.Body>
<Row xs={1} sm={2} xl={2} className="g-3">
{issues?.map(issue => (
<Col key={issue.title}>
<IssueCard className="h-100" {...issue} />
</Col>
))}
</Row>
</Accordion.Body>
</Accordion.Item>
);