cloudaxe-opencode/packages/console/mail/emails/templates/InviteEmail.tsx

83 lines
2.6 KiB
TypeScript
Raw Permalink Normal View History

2025-10-15 03:04:41 +00:00
// @ts-nocheck
2025-10-01 23:34:37 +00:00
import React from "react"
import { Img, Row, Html, Link, Body, Head, Button, Column, Preview, Section, Container } from "@jsx-email/all"
2025-10-15 02:52:35 +00:00
import { Text, Fonts, Title, A, Span } from "../components"
2025-10-01 23:34:37 +00:00
import {
unit,
body,
frame,
2025-10-15 02:52:35 +00:00
headingText,
2025-10-01 23:34:37 +00:00
container,
2025-10-15 02:52:35 +00:00
contentText,
button,
contentHighlightText,
linkText,
buttonText,
2025-10-01 23:34:37 +00:00
} from "../styles"
const CONSOLE_URL = "https://opencode.ai/"
interface InviteEmailProps {
2025-10-11 01:21:55 +00:00
inviter: string
workspaceID: string
workspaceName: string
2025-10-01 23:34:37 +00:00
assetsUrl: string
}
2025-10-11 01:21:55 +00:00
export const InviteEmail = ({
inviter = "test@anoma.ly",
workspaceID = "wrk_01K6XFY7V53T8XN0A7X8G9BTN3",
workspaceName = "anomaly",
2025-10-15 02:52:35 +00:00
assetsUrl = `${CONSOLE_URL}email`,
2025-10-11 01:21:55 +00:00
}: InviteEmailProps) => {
2025-10-11 12:18:57 +00:00
const messagePlain = `${inviter} invited you to join the ${workspaceName} workspace.`
2025-10-11 01:21:55 +00:00
const url = `${CONSOLE_URL}workspace/${workspaceID}`
2025-10-01 23:34:37 +00:00
return (
<Html lang="en">
<Head>
2025-10-11 01:21:55 +00:00
<Title>{`OpenCode — ${messagePlain}`}</Title>
2025-10-01 23:34:37 +00:00
</Head>
<Fonts assetsUrl={assetsUrl} />
<Preview>{messagePlain}</Preview>
<Body style={body} id={Math.random().toString()}>
<Container style={container}>
<Section style={frame}>
<Row>
<Column>
2025-10-11 01:21:55 +00:00
<A href={`${CONSOLE_URL}zen`}>
<Img height="32" alt="OpenCode Logo" src={`${assetsUrl}/logo.png`} />
2025-10-01 23:34:37 +00:00
</A>
</Column>
</Row>
2025-10-15 02:52:35 +00:00
<Section style={{ padding: `${unit * 2}px 0 0 0` }}>
<Text style={headingText}>Join your team's OpenCode workspace</Text>
<Text style={contentText}>
You have been invited by <Span style={contentHighlightText}>{inviter}</Span> to join the{" "}
<Span style={contentHighlightText}>{workspaceName}</Span> workspace on OpenCode.
2025-10-01 23:34:37 +00:00
</Text>
</Section>
2025-10-11 01:21:55 +00:00
<Section style={{ padding: `${unit}px 0 0 0` }}>
2025-10-15 02:52:35 +00:00
<Button style={button} href={url}>
<Text style={buttonText}>
Join workspace
2025-10-15 03:45:06 +00:00
<Img width="24" height="24" src={`${assetsUrl}/right-arrow.png`} alt="Arrow right" />
2025-10-15 02:52:35 +00:00
</Text>
2025-10-11 01:21:55 +00:00
</Button>
</Section>
2025-10-15 02:52:35 +00:00
<Section style={{ padding: `${unit}px 0 0 0` }}>
<Text style={contentText}>Button not working? Copy the following link...</Text>
<Link href={url}>
<Text style={linkText}>{url}</Text>
</Link>
</Section>
2025-10-01 23:34:37 +00:00
</Section>
</Container>
</Body>
</Html>
)
}
export default InviteEmail