| 1 | import { Text } from '@react-email/components'; |
| 2 | |
| 3 | import { text } |
| 4 | import { brand } |
| 5 | import { |
| 6 | kindOf, |
| 7 | Pill, |
| 8 | previewThread, |
| 9 | ThreadEmail, |
| 10 | type ThreadProps, |
| 11 | } from '../components/thread.js'; |
| 12 | |
| 13 | const STATES = { |
| 14 | closed: { label: ' |
| 15 | reopened: { label: ' |
| 16 | merged: { label: ' |
| 17 | } as const; |
| 18 | |
| 19 | interface ThreadStateProps extends |
| 20 | state: keyof |
| 21 | } |
| 22 | |
| 23 | export default function ThreadState |
| 24 | return ( |
| 25 | <ThreadEmail |
| 26 | thread={thread} |
| 27 | preview={`${thread |
| 28 | > |
| 29 | <Text style={ |
| 30 | <Pill color={ |
| 31 | </Text> |
| 32 | <Text style={ |
| 33 | <span style={text |
| 34 | {kindOf(thread)} |
| 35 | </Text> |
| 36 | </ThreadEmail> |
| 37 | ); |
| 38 | } |
| 39 | |
| 40 | ThreadState.PreviewProps = { |
| 41 | ...previewThread, |
| 42 | isPullRequest: true, |
| 43 | path: '/alice/ghost/pulls/42', |
| 44 | reason: 'author', |
| 45 | state: 'merged', |
| 46 | } satisfies ThreadStateProps; |