feat: add basic webui

This commit is contained in:
2024-12-30 06:39:09 +08:00
parent 608a7fb9c6
commit a4c549e7c3
462 changed files with 35900 additions and 2491 deletions

17
packages/email/index.tsx Normal file
View 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');
}
}
}

View 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"
}
}

View 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;

View File

@@ -0,0 +1,8 @@
{
"extends": "@konobangu/typescript-config/react-library.json",
"compilerOptions": {
"baseUrl": "."
},
"include": ["./*.ts", "./*.tsx"],
"exclude": ["node_modules"]
}