style: formatted and added example env

This commit is contained in:
André Brito
2025-01-03 16:47:31 -04:00
committed by Carl-Gerhard Lindesvärd
parent 1dfa079b1e
commit acc675bd36
8 changed files with 106 additions and 102 deletions

View File

@@ -23,7 +23,10 @@
"tailwindCSS.experimental.classRegex": [
["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
["cx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"],
["\\b\\w+ClassName\\s*=\\s*[\"'`]([^\"'`]*)[\"'`]", "[\"'`]([^\"'`]*)[\"'`]" ]
[
"\\b\\w+ClassName\\s*=\\s*[\"'`]([^\"'`]*)[\"'`]",
"[\"'`]([^\"'`]*)[\"'`]"
]
],
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.tsdk": "node_modules/typescript/lib",

View File

@@ -1,6 +1,6 @@
import { clsx, type ClassValue } from "clsx"
import { twMerge } from "tailwind-merge"
import { clsx, type ClassValue } from 'clsx';
import { twMerge } from 'tailwind-merge';
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
return twMerge(clsx(inputs));
}

View File

@@ -2,8 +2,8 @@ import { createPreset } from 'fumadocs-ui/tailwind-plugin';
/** @type {import('tailwindcss').Config} */
export default {
darkMode: ['class'],
content: [
darkMode: ['class'],
content: [
'./components/**/*.{ts,tsx}',
'./app/**/*.{ts,tsx}',
'./content/**/*.{md,mdx}',
@@ -11,88 +11,88 @@ export default {
'./node_modules/fumadocs-ui/dist/**/*.js',
],
presets: [createPreset()],
plugins: [require("tailwindcss-animate")],
corePlugins: {
container: false
},
theme: {
extend: {
screens: {
article: '1530px',
},
borderRadius: {
lg: 'var(--radius)',
md: 'calc(var(--radius) - 2px)',
sm: 'calc(var(--radius) - 4px)'
},
colors: {
background: 'hsl(var(--background))',
'background-light': 'hsl(var(--background-light))',
'background-dark': 'hsl(var(--background-dark))',
foreground: 'hsl(var(--foreground))',
'foreground-dark': 'hsl(var(--foreground-dark))',
'foreground-light': 'hsl(var(--foreground-light))',
card: {
DEFAULT: 'hsl(var(--card))',
foreground: 'hsl(var(--card-foreground))'
},
popover: {
DEFAULT: 'hsl(var(--popover))',
foreground: 'hsl(var(--popover-foreground))'
},
primary: {
DEFAULT: 'hsl(var(--primary))',
foreground: 'hsl(var(--primary-foreground))'
},
secondary: {
DEFAULT: 'hsl(var(--secondary))',
foreground: 'hsl(var(--secondary-foreground))'
},
muted: {
DEFAULT: 'hsl(var(--muted))',
foreground: 'hsl(var(--muted-foreground))'
},
accent: {
DEFAULT: 'hsl(var(--accent))',
foreground: 'hsl(var(--accent-foreground))'
},
destructive: {
DEFAULT: 'hsl(var(--destructive))',
foreground: 'hsl(var(--destructive-foreground))'
},
border: 'hsl(var(--border))',
input: 'hsl(var(--input))',
ring: 'hsl(var(--ring))',
chart: {
'1': 'hsl(var(--chart-1))',
'2': 'hsl(var(--chart-2))',
'3': 'hsl(var(--chart-3))',
'4': 'hsl(var(--chart-4))',
'5': 'hsl(var(--chart-5))'
}
},
keyframes: {
'accordion-down': {
from: {
height: '0'
},
to: {
height: 'var(--radix-accordion-content-height)'
}
},
'accordion-up': {
from: {
height: 'var(--radix-accordion-content-height)'
},
to: {
height: '0'
}
}
},
animation: {
'accordion-down': 'accordion-down 0.2s ease-out',
'accordion-up': 'accordion-up 0.2s ease-out'
}
}
}
plugins: [require('tailwindcss-animate')],
corePlugins: {
container: false,
},
theme: {
extend: {
screens: {
article: '1530px',
},
borderRadius: {
lg: 'var(--radius)',
md: 'calc(var(--radius) - 2px)',
sm: 'calc(var(--radius) - 4px)',
},
colors: {
background: 'hsl(var(--background))',
'background-light': 'hsl(var(--background-light))',
'background-dark': 'hsl(var(--background-dark))',
foreground: 'hsl(var(--foreground))',
'foreground-dark': 'hsl(var(--foreground-dark))',
'foreground-light': 'hsl(var(--foreground-light))',
card: {
DEFAULT: 'hsl(var(--card))',
foreground: 'hsl(var(--card-foreground))',
},
popover: {
DEFAULT: 'hsl(var(--popover))',
foreground: 'hsl(var(--popover-foreground))',
},
primary: {
DEFAULT: 'hsl(var(--primary))',
foreground: 'hsl(var(--primary-foreground))',
},
secondary: {
DEFAULT: 'hsl(var(--secondary))',
foreground: 'hsl(var(--secondary-foreground))',
},
muted: {
DEFAULT: 'hsl(var(--muted))',
foreground: 'hsl(var(--muted-foreground))',
},
accent: {
DEFAULT: 'hsl(var(--accent))',
foreground: 'hsl(var(--accent-foreground))',
},
destructive: {
DEFAULT: 'hsl(var(--destructive))',
foreground: 'hsl(var(--destructive-foreground))',
},
border: 'hsl(var(--border))',
input: 'hsl(var(--input))',
ring: 'hsl(var(--ring))',
chart: {
1: 'hsl(var(--chart-1))',
2: 'hsl(var(--chart-2))',
3: 'hsl(var(--chart-3))',
4: 'hsl(var(--chart-4))',
5: 'hsl(var(--chart-5))',
},
},
keyframes: {
'accordion-down': {
from: {
height: '0',
},
to: {
height: 'var(--radix-accordion-content-height)',
},
},
'accordion-up': {
from: {
height: 'var(--radix-accordion-content-height)',
},
to: {
height: '0',
},
},
},
animation: {
'accordion-down': 'accordion-down 0.2s ease-out',
'accordion-up': 'accordion-up 0.2s ease-out',
},
},
},
};

View File

@@ -1,16 +1,16 @@
import React from "react";
import { Resend } from "resend";
import type { z } from "zod";
import React from 'react';
import { Resend } from 'resend';
import type { z } from 'zod';
import { type TemplateKey, type Templates, templates } from "./emails";
import { type TemplateKey, type Templates, templates } from './emails';
const FROM = process.env.EMAIL_SENDER ?? "hello@openpanel.dev";
const FROM = process.env.EMAIL_SENDER ?? 'hello@openpanel.dev';
export async function sendEmail<T extends TemplateKey>(
template: T,
options: {
to: string | string[];
data: z.infer<Templates[T]["schema"]>;
data: z.infer<Templates[T]['schema']>;
},
) {
const { to, data } = options;
@@ -18,7 +18,7 @@ export async function sendEmail<T extends TemplateKey>(
const props = schema.safeParse(data);
if (props.error) {
console.error("Failed to parse data", props.error);
console.error('Failed to parse data', props.error);
return null;
}
@@ -46,7 +46,7 @@ export async function sendEmail<T extends TemplateKey>(
return res;
} catch (error) {
console.error("Failed to send email", error);
console.error('Failed to send email', error);
return null;
}
}

View File

@@ -3,7 +3,7 @@
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"],
"@/*": ["./src/*"]
},
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
},

View File

@@ -13,3 +13,4 @@ DATABASE_URL_DIRECT="$DATABASE_URL_DIRECT"
NEXT_PUBLIC_DASHBOARD_URL="$NEXT_PUBLIC_DASHBOARD_URL"
NEXT_PUBLIC_API_URL="$NEXT_PUBLIC_API_URL"
COOKIE_SECRET="$COOKIE_SECRET"
EMAIL_SENDER=no-repy@openpanel.dev