feat: add basic webui
This commit is contained in:
17
packages/email/index.tsx
Normal file
17
packages/email/index.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
import type { JSX } from "react";
|
||||
|
||||
export interface SendOptions {
|
||||
from: string;
|
||||
to: string;
|
||||
subject: string;
|
||||
replyTo: string;
|
||||
react: JSX.Element;
|
||||
}
|
||||
|
||||
export const konosend = {
|
||||
emails: {
|
||||
send: async (_props: SendOptions) => {
|
||||
throw new Error('unimplemented');
|
||||
}
|
||||
}
|
||||
}
|
||||
22
packages/email/package.json
Normal file
22
packages/email/package.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "@konobangu/email",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"clean": "git clean -xdf .cache .turbo dist node_modules",
|
||||
"typecheck": "tsc --noEmit --emitDeclarationOnly false"
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-email/components": "0.0.31",
|
||||
"@konobangu/env": "workspace:*",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@konobangu/typescript-config": "workspace:*",
|
||||
"@types/node": "22.10.1",
|
||||
"@types/react": "19.0.1",
|
||||
"@types/react-dom": "^19.0.2",
|
||||
"typescript": "^5.7.2"
|
||||
}
|
||||
}
|
||||
56
packages/email/templates/contact.tsx
Normal file
56
packages/email/templates/contact.tsx
Normal file
@@ -0,0 +1,56 @@
|
||||
import {
|
||||
Body,
|
||||
Container,
|
||||
Head,
|
||||
Hr,
|
||||
Html,
|
||||
Preview,
|
||||
Section,
|
||||
Tailwind,
|
||||
Text,
|
||||
} from '@react-email/components';
|
||||
|
||||
type ContactTemplateProps = {
|
||||
readonly name: string;
|
||||
readonly email: string;
|
||||
readonly message: string;
|
||||
};
|
||||
|
||||
export const ContactTemplate = ({
|
||||
name,
|
||||
email,
|
||||
message,
|
||||
}: ContactTemplateProps) => (
|
||||
<Tailwind>
|
||||
<Html>
|
||||
<Head />
|
||||
<Preview>New email from {name}</Preview>
|
||||
<Body className="bg-zinc-50 font-sans">
|
||||
<Container className="mx-auto py-12">
|
||||
<Section className="mt-8 rounded-md bg-zinc-200 p-px">
|
||||
<Section className="rounded-[5px] bg-white p-8">
|
||||
<Text className="mt-0 mb-4 font-semibold text-2xl text-zinc-950">
|
||||
New email from {name}
|
||||
</Text>
|
||||
<Text className="m-0 text-zinc-500">
|
||||
{name} ({email}) has sent you a message:
|
||||
</Text>
|
||||
<Hr className="my-4" />
|
||||
<Text className="m-0 text-zinc-500">{message}</Text>
|
||||
</Section>
|
||||
</Section>
|
||||
</Container>
|
||||
</Body>
|
||||
</Html>
|
||||
</Tailwind>
|
||||
);
|
||||
|
||||
const ExampleContactEmail = () => (
|
||||
<ContactTemplate
|
||||
name="Jane Smith"
|
||||
email="jane@example.com"
|
||||
message="Hello, how do I get started?"
|
||||
/>
|
||||
);
|
||||
|
||||
export default ExampleContactEmail;
|
||||
8
packages/email/tsconfig.json
Normal file
8
packages/email/tsconfig.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "@konobangu/typescript-config/react-library.json",
|
||||
"compilerOptions": {
|
||||
"baseUrl": "."
|
||||
},
|
||||
"include": ["./*.ts", "./*.tsx"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
Reference in New Issue
Block a user