forked from openedx/frontend-app-authoring
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTitleLink.tsx
More file actions
36 lines (33 loc) · 749 Bytes
/
TitleLink.tsx
File metadata and controls
36 lines (33 loc) · 749 Bytes
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
import { Link } from 'react-router-dom';
import { Button } from '@openedx/paragon';
interface TitleLinkProps {
title: string;
titleLink: string;
namePrefix: string;
prefixIcon?: React.ReactNode;
}
const TitleLink = ({
title,
titleLink,
namePrefix,
prefixIcon,
}: TitleLinkProps) => (
<>
<div className="mr-2">
{prefixIcon}
</div>
<Button
as={Link}
variant="tertiary"
data-testid={`${namePrefix}-card-header__title-link`}
className="item-card-header__title-btn align-items-end"
to={titleLink}
title={title}
>
<span className={`${namePrefix}-card-title mb-0 truncate-1-line text-left`}>
{title}
</span>
</Button>
</>
);
export default TitleLink;