| 1 | import { Text } from '@react-email/components'; |
| 2 | |
| 3 | import { text } |
| 4 | import { |
| 5 | previewThread, |
| 6 | Quote, |
| 7 | ThreadEmail, |
| 8 | type ThreadProps, |
| 9 | } from '../components/thread.js'; |
| 10 | |
| 11 | interface ThreadCommentProps extends |
| 12 | body: string; |
| 13 | /** The file a review comment is on; null for a comment on the conversation. */ |
| 14 | file: string |
| 15 | } |
| 16 | |
| 17 | export default function ThreadComment |
| 18 | body, |
| 19 | file, |
| 20 | ...thread |
| 21 | }: ThreadCommentProps) |
| 22 | return ( |
| 23 | <ThreadEmail |
| 24 | thread={thread} |
| 25 | preview={`${thread |
| 26 | > |
| 27 | <Text style={ |
| 28 | <span style={text |
| 29 | {file && ( |
| 30 | <> |
| 31 | {' '} |
| 32 | on <span style={text |
| 33 | </> |
| 34 | )} |
| 35 | : |
| 36 | </Text> |
| 37 | <Quote>{body} |
| 38 | </ThreadEmail> |
| 39 | ); |
| 40 | } |
| 41 | |
| 42 | ThreadComment.PreviewProps = { |
| 43 | ...previewThread, |
| 44 | reason: 'mentioned', |
| 45 | body: '@alice this needs a count, not only a dot. What do you think?', |
| 46 | file: null, |
| 47 | } satisfies ThreadCommentProps; |