-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathOriginator.tsx
More file actions
30 lines (23 loc) · 845 Bytes
/
Originator.tsx
File metadata and controls
30 lines (23 loc) · 845 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
import React, { memo } from 'react';
import { type ReplyAction } from '../../types/external/OrgSchema/ReplyAction';
type Props = Readonly<{ replyAction: ReplyAction }>;
const Originator = memo(({ replyAction }: Props) => {
const { description, provider } = replyAction;
const text = description || provider?.name;
const url = provider?.url;
return url ? (
<a
className="webchat__activity-status__originator webchat__activity-status__originator--has-link"
href={url}
rel="noopener noreferrer"
target="_blank"
title={text} // In case the content is clipped with ellipsis, customers can hover to see the full text.
>
{text}
</a>
) : (
<span className="webchat__activity-status__originator">{text}</span>
);
});
Originator.displayName = 'Originator';
export default Originator;