forked from CaliCastle/cali.so
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNewGuestbook.tsx
69 lines (62 loc) · 1.91 KB
/
NewGuestbook.tsx
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import * as React from 'react'
import ReactMarkdown from 'react-markdown'
import { parseDisplayName } from '../lib/string'
import { Button, Heading, Hr, Img, Section, Text } from './_components'
import Layout from './Layout'
const NewGuestbookEmail = ({
link = 'https://caliso/guestbook',
userFirstName = 'Cali',
userLastName = 'Castle',
userImageUrl = 'https://cali.so/icon.png',
commentContent = '*测试评论*\n- Wow wtf\n- Cool',
}: {
link?: string | null
userFirstName?: string | null
userLastName?: string | null
userImageUrl?: string | null
commentContent?: string | null
}) => {
const user = parseDisplayName({
firstName: userFirstName,
lastName: userLastName,
})
const title = `有人在留言墙留言啦`
return (
<Layout previewText={title}>
<Heading>{title}</Heading>
<Section className="mt-[24px]">
<Text className="text-[14px] leading-[24px] text-black">
{userImageUrl && (
<Img
src={userImageUrl}
alt=""
width="24"
height="24"
className="rounded-full"
/>
)}
</Text>
<Text className="text-[14px] leading-[24px] text-black">
<b>{user}</b> 在留言墙留言:
</Text>
</Section>
<Section className="px-2 text-[14px] leading-[16px] text-zinc-700">
{commentContent && <ReactMarkdown>{commentContent}</ReactMarkdown>}
</Section>
<Hr className="mx-0 my-[26px] h-px w-full bg-zinc-100" />
<Section className="mb-[32px] mt-[32px] text-center">
{link && (
<Button
pX={20}
pY={12}
className="rounded-xl bg-zinc-900 text-center text-[12px] font-semibold text-white no-underline"
href={link}
>
查看留言
</Button>
)}
</Section>
</Layout>
)
}
export default NewGuestbookEmail