| 1 | import { |
| 2 | Body, |
| 3 | Column, |
| 4 | Container, |
| 5 | Font, |
| 6 | Head, |
| 7 | Hr, |
| 8 | Html, |
| 9 | Img, |
| 10 | Link, |
| 11 | Preview, |
| 12 | Row, |
| 13 | Section, |
| 14 | Text, |
| 15 | } from '@react-email/components' |
| 16 | import type { ReactNode |
| 17 | import { env } |
| 18 | |
| 19 | const baseUrl = env |
| 20 | |
| 21 | interface EmailLayoutProps { |
| 22 | accentColor?: string |
| 23 | children: ReactNode |
| 24 | heading: string |
| 25 | preview: string |
| 26 | } |
| 27 | |
| 28 | export function EmailLayout({ |
| 29 | preview, |
| 30 | heading, |
| 31 | accentColor = '#7c3aed' |
| 32 | children, |
| 33 | }: EmailLayoutProps) |
| 34 | return ( |
| 35 | <Html> |
| 36 | <Head> |
| 37 | <Font |
| 38 | fallbackFontFamily='Helvetica' |
| 39 | fontFamily='Inter' |
| 40 | fontStyle='normal' |
| 41 | fontWeight={400} |
| 42 | webFont={{ |
| 43 | url: 'https://fonts.gstatic.com/s/geist/v4/gyByhwUxId8gMEwYGFWNOITddY4.woff2', |
| 44 | format: 'woff2', |
| 45 | }} |
| 46 | /> |
| 47 | <Font |
| 48 | fallbackFontFamily='Helvetica' |
| 49 | fontFamily='Inter' |
| 50 | fontStyle='normal' |
| 51 | fontWeight={600} |
| 52 | webFont={{ |
| 53 | url: 'https://fonts.gstatic.com/s/inter/v18/UcCo3FwrK3iLTcviYwY.woff2', |
| 54 | format: 'woff2', |
| 55 | }} |
| 56 | /> |
| 57 | </Head> |
| 58 | <Preview>{preview} |
| 59 | <Body style={ |
| 60 | <Container style={ |
| 61 | <Section style={ |
| 62 | <Row> |
| 63 | <Column> |
| 64 | <Link href={ |
| 65 | <Img |
| 66 | alt='Saturn' |
| 67 | height={'30'} |
| 68 | // height="24" |
| 69 | src={`${baseUrl |
| 70 | /> |
| 71 | </Link> |
| 72 | </Column> |
| 73 | <Column align=' |
| 74 | <Img |
| 75 | alt='Saturn' |
| 76 | height={'24'} |
| 77 | src={`${baseUrl |
| 78 | /> |
| 79 | </Column> |
| 80 | </Row> |
| 81 | </Section> |
| 82 | <Section style={ |
| 83 | <Text |
| 84 | style={{ |
| 85 | ...headingStyle, |
| 86 | borderLeft: `3px solid ${accentColor |
| 87 | paddingLeft: '14px', |
| 88 | }} |
| 89 | > |
| 90 | {heading} |
| 91 | </Text> |
| 92 | </Section> |
| 93 | <Section style={ |
| 94 | <Hr style={ |
| 95 | <Section style={ |
| 96 | <Text style={ |
| 97 | You received this because you're part of a Saturn workspace. |
| 98 | </Text> |
| 99 | <Text style={ |
| 100 | <Link href={ |
| 101 | Open Saturn |
| 102 | </Link> |
| 103 | </Text> |
| 104 | </Section> |
| 105 | </Container> |
| 106 | </Body> |
| 107 | </Html> |
| 108 | ) |
| 109 | } |
| 110 | |
| 111 | export function ActionButton({ |
| 112 | href, |
| 113 | children, |
| 114 | // biome-ignore lint/correctness/noUnusedFunctionParameters: To have a constant brand color |
| 115 | color = '#7c3aed' |
| 116 | }: { |
| 117 | href: string |
| 118 | children: ReactNode |
| 119 | color?: string |
| 120 | }) { |
| 121 | return ( |
| 122 | <Section style={ |
| 123 | <Link |
| 124 | href={href} |
| 125 | style={{ |
| 126 | ...button, |
| 127 | backgroundColor: '#7c3aed', |
| 128 | }} |
| 129 | > |
| 130 | {children} |
| 131 | </Link> |
| 132 | </Section> |
| 133 | ) |
| 134 | } |
| 135 | |
| 136 | export function InfoCard({ |
| 137 | return <Section style |
| 138 | } |
| 139 | |
| 140 | export function InfoRow({ |
| 141 | return ( |
| 142 | <Row style={ |
| 143 | <Column style={ |
| 144 | <Column align=' |
| 145 | {value} |
| 146 | </Column> |
| 147 | </Row> |
| 148 | ) |
| 149 | } |
| 150 | |
| 151 | export function Badge({ |
| 152 | children, |
| 153 | color = '#7c3aed' |
| 154 | }: { |
| 155 | children: ReactNode |
| 156 | color?: string |
| 157 | }) { |
| 158 | return ( |
| 159 | <span |
| 160 | style={{ |
| 161 | backgroundColor: `${color} |
| 162 | color, |
| 163 | fontSize: '11px', |
| 164 | fontWeight: '600', |
| 165 | padding: '3px 10px', |
| 166 | borderRadius: '20px', |
| 167 | textTransform: 'uppercase' as |
| 168 | letterSpacing: '0.5px', |
| 169 | }} |
| 170 | > |
| 171 | {children} |
| 172 | </span> |
| 173 | ) |
| 174 | } |
| 175 | |
| 176 | export function QuoteBlock({ |
| 177 | children, |
| 178 | borderColor = '#e4e4e7' |
| 179 | }: { |
| 180 | children: ReactNode |
| 181 | borderColor?: string |
| 182 | }) { |
| 183 | return ( |
| 184 | <Section |
| 185 | style={{ |
| 186 | ...quoteBlock, |
| 187 | borderLeft: `3px solid ${borderColor |
| 188 | }} |
| 189 | > |
| 190 | {children} |
| 191 | </Section> |
| 192 | ) |
| 193 | } |
| 194 | |
| 195 | // Reusable text styles |
| 196 | export const text = |
| 197 | paragraph: { |
| 198 | fontSize: '14px', |
| 199 | color: '#3f3f46', |
| 200 | lineHeight: '24px', |
| 201 | margin: '0 0 16px', |
| 202 | } as React. |
| 203 | muted: { |
| 204 | fontSize: '13px', |
| 205 | color: '#a1a1aa', |
| 206 | lineHeight: '20px', |
| 207 | margin: '0', |
| 208 | } as React. |
| 209 | strong: { |
| 210 | color: '#18181b', |
| 211 | fontWeight: '600', |
| 212 | } as React. |
| 213 | large: { |
| 214 | fontSize: '28px', |
| 215 | fontWeight: '700', |
| 216 | lineHeight: '1', |
| 217 | margin: '0', |
| 218 | textAlign: 'center' as |
| 219 | } as React. |
| 220 | } |
| 221 | |
| 222 | // Layout styles |
| 223 | const body = { |
| 224 | backgroundColor: '#fafafa', |
| 225 | fontFamily: 'Inter, Helvetica, Arial, sans-serif', |
| 226 | margin: '0', |
| 227 | padding: '0', |
| 228 | } |
| 229 | |
| 230 | const container = { |
| 231 | backgroundColor: '#ffffff', |
| 232 | borderRadius: '16px', |
| 233 | margin: '40px auto', |
| 234 | maxWidth: '520px', |
| 235 | overflow: 'hidden' as |
| 236 | boxShadow: '0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04)', |
| 237 | } |
| 238 | |
| 239 | const headerSection = { |
| 240 | padding: '24px 32px 0', |
| 241 | } |
| 242 | |
| 243 | const logoLink = { |
| 244 | textDecoration: 'none', |
| 245 | } |
| 246 | |
| 247 | const headingSection = { |
| 248 | padding: '20px 32px 0', |
| 249 | } |
| 250 | |
| 251 | const headingStyle = { |
| 252 | fontSize: '22px', |
| 253 | fontWeight: '700', |
| 254 | color: '#09090b', |
| 255 | margin: '0', |
| 256 | lineHeight: '28px', |
| 257 | } |
| 258 | |
| 259 | const content = { |
| 260 | padding: '16px 32px 24px', |
| 261 | } |
| 262 | |
| 263 | const hr = { |
| 264 | borderColor: '#f4f4f5', |
| 265 | margin: '0', |
| 266 | } |
| 267 | |
| 268 | const footer = { |
| 269 | padding: '20px 32px 24px', |
| 270 | backgroundColor: '#fafafa', |
| 271 | } |
| 272 | |
| 273 | const footerText = { |
| 274 | color: '#a1a1aa', |
| 275 | fontSize: '12px', |
| 276 | margin: '0 0 6px', |
| 277 | textAlign: 'center' as |
| 278 | lineHeight: '18px', |
| 279 | } |
| 280 | |
| 281 | const footerLinks = { |
| 282 | color: '#a1a1aa', |
| 283 | fontSize: '12px', |
| 284 | margin: '0', |
| 285 | textAlign: 'center' as |
| 286 | } |
| 287 | |
| 288 | const footerLink = { |
| 289 | color: '#71717a', |
| 290 | textDecoration: 'underline', |
| 291 | } |
| 292 | |
| 293 | const buttonSection = { |
| 294 | textAlign: 'center' as |
| 295 | margin: '24px 0 8px', |
| 296 | } |
| 297 | |
| 298 | const button = { |
| 299 | borderRadius: '10px', |
| 300 | color: '#ffffff', |
| 301 | display: 'inline-block', |
| 302 | fontSize: '14px', |
| 303 | fontWeight: '600', |
| 304 | padding: '12px 32px', |
| 305 | textDecoration: 'none', |
| 306 | } |
| 307 | |
| 308 | const infoCard = { |
| 309 | backgroundColor: '#fafafa', |
| 310 | borderRadius: '12px', |
| 311 | padding: '16px 20px', |
| 312 | margin: '16px 0', |
| 313 | border: '1px solid #f4f4f5', |
| 314 | } |
| 315 | |
| 316 | const infoRow = { |
| 317 | padding: '6px 0', |
| 318 | } |
| 319 | |
| 320 | const infoLabel = { |
| 321 | fontSize: '13px', |
| 322 | color: '#71717a', |
| 323 | } |
| 324 | |
| 325 | const infoValue = { |
| 326 | fontSize: '14px', |
| 327 | color: '#18181b', |
| 328 | fontWeight: '600', |
| 329 | } |
| 330 | |
| 331 | const quoteBlock = { |
| 332 | backgroundColor: '#fafafa', |
| 333 | borderRadius: '0 8px 8px 0', |
| 334 | padding: '12px 16px', |
| 335 | margin: '16px 0', |
| 336 | } |