style: added shadcn-ui

This commit is contained in:
Riccardo
2023-12-05 20:13:29 +01:00
parent 1b0919a460
commit 78de374cba
45 changed files with 1463 additions and 1340 deletions

View File

@@ -1,9 +1,13 @@
import { Resend } from 'resend';
type EmailTemplate = {
subject: string;
template: JSX.Element;
};
export async function sendEmail(
to: string[],
subject: string,
template: JSX.Element
{ subject, template }: EmailTemplate
) {
const resend = new Resend(process.env.RESEND_KEY);
@@ -21,4 +25,6 @@ export async function sendEmail(
} catch (error) {
console.log(error);
}
console.log('Email sent', subject, to.length);
}

View File

@@ -6,6 +6,7 @@ export const ResponseSchema = z.object({
export const SubscribeFormSchema = z.object({
email: z.string().email(),
name: z.string().optional(),
});
export const ConfirmationSchema = z.object({
@@ -14,9 +15,10 @@ export const ConfirmationSchema = z.object({
export const UnsubscribeFormSchema = z.object({
email: z.string().email(),
name: z.string().optional(),
});
export const NewsSchema = z.object({
export const NewsDatabaseSchema = z.object({
id: z.number(),
title: z.string(),
text: z.string().optional(),
@@ -26,3 +28,15 @@ export const NewsSchema = z.object({
url: z.string().optional(),
score: z.number(),
});
export const NewsSchema = z.object({
id: z.number(),
title: z.string(),
text: z.string().nullable(),
type: z.string(),
by: z.string(),
time: z.number(),
url: z.string().nullable(),
score: z.number(),
createdAt: z.date(),
});

6
utils/utils.ts Normal file
View File

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