Merge remote-tracking branch 'refs/remotes/origin/develop' into develop
This commit is contained in:
@@ -12,7 +12,7 @@ import {
|
||||
type UpdateEmailRequestDto,
|
||||
} from "@/lib/api/emailRequests";
|
||||
import { Pencil, Trash2, Plus, X } from "lucide-react";
|
||||
|
||||
import { formatDate } from "@/lib/api/dateFormattingUtility";
|
||||
export default function AdminEmailPage() {
|
||||
const { token } = useAuth();
|
||||
const [emails, setEmails] = useState<EmailRequest[]>([]);
|
||||
@@ -165,7 +165,7 @@ export default function AdminEmailPage() {
|
||||
{new Date(email.createdAt).toLocaleString()}
|
||||
</td>
|
||||
<td className="px-3 py-2 text-[11px] text-zinc-400">
|
||||
{new Date(email.updatedAt).toLocaleString()}
|
||||
{formatDate(email.updatedAt)}
|
||||
</td>
|
||||
<td className="px-3 py-2 text-right">
|
||||
<div className="flex items-center justify-end gap-2">
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { sendEmailAction, type ApiResponse, type EmailRequest } from "/app/actions/sendEmail";
|
||||
import { Button, Field, Input, Textarea } from "@/components/ui/form";
|
||||
|
||||
export default function SendEmailForm(): JSX.Element {
|
||||
const [result, setResult] = useState<
|
||||
ApiResponse<EmailRequest> | { error: string } | null
|
||||
>(null);
|
||||
const [submitting, setSubmitting] = useState(false);
|
||||
|
||||
const [showSuccess, setShowSuccess] = useState(false);
|
||||
const successTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
if (successTimerRef.current) clearTimeout(successTimerRef.current);
|
||||
};
|
||||
}, []);
|
||||
|
||||
async function onSubmit(e: React.FormEvent<HTMLFormElement>): Promise<void> {
|
||||
e.preventDefault();
|
||||
setResult(null);
|
||||
|
||||
setShowSuccess(false);
|
||||
if (successTimerRef.current) clearTimeout(successTimerRef.current);
|
||||
|
||||
const form = new FormData(e.currentTarget);
|
||||
|
||||
const recipient = String(form.get("recipient") ?? "");
|
||||
const subject = String(form.get("subject") ?? "");
|
||||
const body = String(form.get("body") ?? "");
|
||||
|
||||
try {
|
||||
setSubmitting(true);
|
||||
const data = await sendEmailAction({ recipient, subject, body });
|
||||
setResult(data);
|
||||
|
||||
if (data?.success === true) {
|
||||
setShowSuccess(true);
|
||||
|
||||
successTimerRef.current = setTimeout(() => {
|
||||
setShowSuccess(false);
|
||||
}, 2000);
|
||||
}
|
||||
} catch (err) {
|
||||
const message = err instanceof Error ? err.message : "Unknown error";
|
||||
setResult({ error: message });
|
||||
} finally {
|
||||
setSubmitting(false);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="mx-auto w-full max-w-xl px-4 py-10 text-zinc-50">
|
||||
<h1 className="text-2xl font-semibold tracking-tight">
|
||||
Send <span className="text-amber-300">Email</span>
|
||||
</h1>
|
||||
<p className="mt-2 text-sm text-zinc-400">
|
||||
Compose a message and send it from the admin panel.
|
||||
</p>
|
||||
|
||||
<form onSubmit={onSubmit} className="mt-6 space-y-4">
|
||||
{result && "error" in result && (
|
||||
<div className="rounded-md border border-red-500/40 bg-red-500/10 px-3 py-2 text-sm text-red-200">
|
||||
{result.error}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<Field label="Recipient" htmlFor="recipient">
|
||||
<Input
|
||||
id="recipient"
|
||||
name="recipient"
|
||||
type="email"
|
||||
placeholder="user@example.com"
|
||||
defaultValue="user@example.com"
|
||||
required
|
||||
/>
|
||||
</Field>
|
||||
|
||||
<Field label="Subject" htmlFor="subject">
|
||||
<Input
|
||||
id="subject"
|
||||
name="subject"
|
||||
placeholder="Test subject"
|
||||
defaultValue="Test subject"
|
||||
required
|
||||
/>
|
||||
</Field>
|
||||
|
||||
<Field label="Body" htmlFor="body">
|
||||
<Textarea
|
||||
id="body"
|
||||
name="body"
|
||||
placeholder="Write your message…"
|
||||
defaultValue="Test body"
|
||||
rows={6}
|
||||
required
|
||||
/>
|
||||
</Field>
|
||||
|
||||
<Button type="submit" disabled={submitting}>
|
||||
{submitting ? "Sending…" : showSuccess ? "Success" : "Send"}
|
||||
</Button>
|
||||
|
||||
<div className="rounded-md border border-zinc-800 bg-zinc-950/60 p-3">
|
||||
<div className="text-xs font-medium text-zinc-400">Response</div>
|
||||
<pre className="mt-2 overflow-x-auto text-xs text-zinc-200">
|
||||
{result ? JSON.stringify(result, null, 2) : "No response yet."}
|
||||
</pre>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,116 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { sendEmailAction, type ApiResponse, type EmailRequest } from "/app/actions/sendEmail";
|
||||
import { Button, Field, Input, Textarea } from "@/components/ui/form";
|
||||
|
||||
export default function SendEmailForm(): JSX.Element {
|
||||
const [result, setResult] = useState<
|
||||
ApiResponse<EmailRequest> | { error: string } | null
|
||||
>(null);
|
||||
const [submitting, setSubmitting] = useState(false);
|
||||
|
||||
const [showSuccess, setShowSuccess] = useState(false);
|
||||
const successTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
if (successTimerRef.current) clearTimeout(successTimerRef.current);
|
||||
};
|
||||
}, []);
|
||||
|
||||
async function onSubmit(e: React.FormEvent<HTMLFormElement>): Promise<void> {
|
||||
e.preventDefault();
|
||||
setResult(null);
|
||||
|
||||
setShowSuccess(false);
|
||||
if (successTimerRef.current) clearTimeout(successTimerRef.current);
|
||||
|
||||
const form = new FormData(e.currentTarget);
|
||||
|
||||
const recipient = String(form.get("recipient") ?? "");
|
||||
const subject = String(form.get("subject") ?? "");
|
||||
const body = String(form.get("body") ?? "");
|
||||
|
||||
try {
|
||||
setSubmitting(true);
|
||||
const data = await sendEmailAction({ recipient, subject, body });
|
||||
setResult(data);
|
||||
|
||||
if (data?.success === true) {
|
||||
setShowSuccess(true);
|
||||
|
||||
successTimerRef.current = setTimeout(() => {
|
||||
setShowSuccess(false);
|
||||
}, 2000);
|
||||
}
|
||||
} catch (err) {
|
||||
const message = err instanceof Error ? err.message : "Unknown error";
|
||||
setResult({ error: message });
|
||||
} finally {
|
||||
setSubmitting(false);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="mx-auto w-full max-w-xl px-4 py-10 text-zinc-50">
|
||||
<h1 className="text-2xl font-semibold tracking-tight">
|
||||
Send <span className="text-amber-300">Email</span>
|
||||
</h1>
|
||||
<p className="mt-2 text-sm text-zinc-400">
|
||||
Compose a message and send it from the admin panel.
|
||||
</p>
|
||||
|
||||
<form onSubmit={onSubmit} className="mt-6 space-y-4">
|
||||
{result && "error" in result && (
|
||||
<div className="rounded-md border border-red-500/40 bg-red-500/10 px-3 py-2 text-sm text-red-200">
|
||||
{result.error}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<Field label="Recipient" htmlFor="recipient">
|
||||
<Input
|
||||
id="recipient"
|
||||
name="recipient"
|
||||
type="email"
|
||||
placeholder="user@example.com"
|
||||
defaultValue="user@example.com"
|
||||
required
|
||||
/>
|
||||
</Field>
|
||||
|
||||
<Field label="Subject" htmlFor="subject">
|
||||
<Input
|
||||
id="subject"
|
||||
name="subject"
|
||||
placeholder="Test subject"
|
||||
defaultValue="Test subject"
|
||||
required
|
||||
/>
|
||||
</Field>
|
||||
|
||||
<Field label="Body" htmlFor="body">
|
||||
<Textarea
|
||||
id="body"
|
||||
name="body"
|
||||
placeholder="Write your message…"
|
||||
defaultValue="Test body"
|
||||
rows={6}
|
||||
required
|
||||
/>
|
||||
</Field>
|
||||
|
||||
<Button type="submit" disabled={submitting}>
|
||||
{submitting ? "Sending…" : showSuccess ? "Success" : "Send"}
|
||||
</Button>
|
||||
|
||||
<div className="rounded-md border border-zinc-800 bg-zinc-950/60 p-3">
|
||||
<div className="text-xs font-medium text-zinc-400">Response</div>
|
||||
<pre className="mt-2 overflow-x-auto text-xs text-zinc-200">
|
||||
{result ? JSON.stringify(result, null, 2) : "No response yet."}
|
||||
</pre>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
"use client";
|
||||
|
||||
import SendEmailForm from "@/components/SendEmail";
|
||||
|
||||
export default function SendEmailPage() {
|
||||
return <SendEmailForm />;
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { sendEmailAction, type ApiResponse, type EmailRequest } from "/app/actions/sendEmail";
|
||||
import { Button, Field, Input, Textarea } from "@/components/ui/form";
|
||||
|
||||
export default function SendEmailForm(): JSX.Element {
|
||||
const [result, setResult] = useState<
|
||||
ApiResponse<EmailRequest> | { error: string } | null
|
||||
>(null);
|
||||
const [submitting, setSubmitting] = useState(false);
|
||||
|
||||
const [showSuccess, setShowSuccess] = useState(false);
|
||||
const successTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
if (successTimerRef.current) clearTimeout(successTimerRef.current);
|
||||
};
|
||||
}, []);
|
||||
|
||||
async function onSubmit(e: React.FormEvent<HTMLFormElement>): Promise<void> {
|
||||
e.preventDefault();
|
||||
setResult(null);
|
||||
|
||||
setShowSuccess(false);
|
||||
if (successTimerRef.current) clearTimeout(successTimerRef.current);
|
||||
|
||||
const form = new FormData(e.currentTarget);
|
||||
|
||||
const recipient = String(form.get("recipient") ?? "");
|
||||
const subject = String(form.get("subject") ?? "");
|
||||
const body = String(form.get("body") ?? "");
|
||||
|
||||
try {
|
||||
setSubmitting(true);
|
||||
const data = await sendEmailAction({ recipient, subject, body });
|
||||
setResult(data);
|
||||
|
||||
if (data?.success === true) {
|
||||
setShowSuccess(true);
|
||||
|
||||
successTimerRef.current = setTimeout(() => {
|
||||
setShowSuccess(false);
|
||||
setResult(null); // clear the response panel too
|
||||
}, 2000);
|
||||
}
|
||||
} catch (err) {
|
||||
const message = err instanceof Error ? err.message : "Unknown error";
|
||||
setResult({ error: message });
|
||||
} finally {
|
||||
setSubmitting(false);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="mx-auto w-full max-w-xl px-4 py-10 text-zinc-50">
|
||||
<h1 className="text-2xl font-semibold tracking-tight">
|
||||
Send <span className="text-amber-300">Email</span>
|
||||
</h1>
|
||||
<p className="mt-2 text-sm text-zinc-400">
|
||||
Compose a message and send it from the admin panel.
|
||||
</p>
|
||||
|
||||
<form onSubmit={onSubmit} className="mt-6 space-y-4">
|
||||
{result && "error" in result && (
|
||||
<div className="rounded-md border border-red-500/40 bg-red-500/10 px-3 py-2 text-sm text-red-200">
|
||||
{result.error}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<Field label="Recipient" htmlFor="recipient">
|
||||
<Input
|
||||
id="recipient"
|
||||
name="recipient"
|
||||
type="email"
|
||||
placeholder="user@example.com"
|
||||
defaultValue="user@example.com"
|
||||
required
|
||||
/>
|
||||
</Field>
|
||||
|
||||
<Field label="Subject" htmlFor="subject">
|
||||
<Input
|
||||
id="subject"
|
||||
name="subject"
|
||||
placeholder="Test subject"
|
||||
defaultValue="Test subject"
|
||||
required
|
||||
/>
|
||||
</Field>
|
||||
|
||||
<Field label="Body" htmlFor="body">
|
||||
<Textarea
|
||||
id="body"
|
||||
name="body"
|
||||
placeholder="Write your message…"
|
||||
defaultValue="Test body"
|
||||
rows={6}
|
||||
required
|
||||
/>
|
||||
</Field>
|
||||
|
||||
<Button type="submit" disabled={submitting}>
|
||||
{submitting ? "Sending…" : showSuccess ? "Success" : "Send"}
|
||||
</Button>
|
||||
|
||||
<div className="rounded-md border border-zinc-800 bg-zinc-950/60 p-3">
|
||||
<div className="text-xs font-medium text-zinc-400">Response</div>
|
||||
<pre className="mt-2 overflow-x-auto text-xs text-zinc-200">
|
||||
{result ? JSON.stringify(result, null, 2) : "No response yet."}
|
||||
</pre>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
+63
-55
@@ -2,17 +2,20 @@
|
||||
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { sendEmailAction, type ApiResponse, type EmailRequest } from "/app/actions/sendEmail";
|
||||
import { Button, Field, Input, Textarea } from "@/components/ui/form";
|
||||
import { Button, Field, Input } from "@/components/ui/form";
|
||||
import RichTextEditor from "@/components/ui/RichTextEditor";
|
||||
|
||||
export default function SendEmailForm(): JSX.Element {
|
||||
const [result, setResult] = useState<
|
||||
ApiResponse<EmailRequest> | { error: string } | null
|
||||
ApiResponse<EmailRequest> | { error: string } | null
|
||||
>(null);
|
||||
const [submitting, setSubmitting] = useState(false);
|
||||
|
||||
const [showSuccess, setShowSuccess] = useState(false);
|
||||
const successTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||
|
||||
const [bodyHtml, setBodyHtml] = useState<string>("");
|
||||
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
if (successTimerRef.current) clearTimeout(successTimerRef.current);
|
||||
@@ -30,7 +33,7 @@ export default function SendEmailForm(): JSX.Element {
|
||||
|
||||
const recipient = String(form.get("recipient") ?? "");
|
||||
const subject = String(form.get("subject") ?? "");
|
||||
const body = String(form.get("body") ?? "");
|
||||
const body = String(form.get("body") ?? ""); // HTML from hidden input
|
||||
|
||||
try {
|
||||
setSubmitting(true);
|
||||
@@ -42,7 +45,7 @@ export default function SendEmailForm(): JSX.Element {
|
||||
|
||||
successTimerRef.current = setTimeout(() => {
|
||||
setShowSuccess(false);
|
||||
setResult(null); // clear the response panel too
|
||||
setResult(null);
|
||||
}, 2000);
|
||||
}
|
||||
} catch (err) {
|
||||
@@ -54,64 +57,69 @@ export default function SendEmailForm(): JSX.Element {
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="mx-auto w-full max-w-xl px-4 py-10 text-zinc-50">
|
||||
<h1 className="text-2xl font-semibold tracking-tight">
|
||||
Send <span className="text-amber-300">Email</span>
|
||||
</h1>
|
||||
<p className="mt-2 text-sm text-zinc-400">
|
||||
Compose a message and send it from the admin panel.
|
||||
</p>
|
||||
<div className="mx-auto w-full max-w-xl px-4 py-10 text-zinc-50">
|
||||
<h1 className="text-2xl font-semibold tracking-tight">
|
||||
Send <span className="text-amber-300">Email</span>
|
||||
</h1>
|
||||
<p className="mt-2 text-sm text-zinc-400">
|
||||
Compose a message and send it from the admin panel.
|
||||
</p>
|
||||
|
||||
<form onSubmit={onSubmit} className="mt-6 space-y-4">
|
||||
{result && "error" in result && (
|
||||
<div className="rounded-md border border-red-500/40 bg-red-500/10 px-3 py-2 text-sm text-red-200">
|
||||
{result.error}
|
||||
</div>
|
||||
)}
|
||||
<form onSubmit={onSubmit} className="mt-6 space-y-4">
|
||||
{result && "error" in result && (
|
||||
<div className="rounded-md border border-red-500/40 bg-red-500/10 px-3 py-2 text-sm text-red-200">
|
||||
{result.error}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<Field label="Recipient" htmlFor="recipient">
|
||||
<Input
|
||||
id="recipient"
|
||||
name="recipient"
|
||||
type="email"
|
||||
placeholder="user@example.com"
|
||||
defaultValue="user@example.com"
|
||||
required
|
||||
/>
|
||||
</Field>
|
||||
<Field label="Recipient" htmlFor="recipient">
|
||||
<Input
|
||||
id="recipient"
|
||||
name="recipient"
|
||||
type="email"
|
||||
placeholder="user@example.com"
|
||||
defaultValue="user@example.com"
|
||||
required
|
||||
/>
|
||||
</Field>
|
||||
|
||||
<Field label="Subject" htmlFor="subject">
|
||||
<Input
|
||||
id="subject"
|
||||
name="subject"
|
||||
placeholder="Test subject"
|
||||
defaultValue="Test subject"
|
||||
required
|
||||
/>
|
||||
</Field>
|
||||
<Field label="Subject" htmlFor="subject">
|
||||
<Input
|
||||
id="subject"
|
||||
name="subject"
|
||||
placeholder="Subject…"
|
||||
defaultValue="Test subject"
|
||||
required
|
||||
/>
|
||||
</Field>
|
||||
|
||||
<Field label="Body" htmlFor="body">
|
||||
<Textarea
|
||||
id="body"
|
||||
name="body"
|
||||
placeholder="Write your message…"
|
||||
defaultValue="Test body"
|
||||
rows={6}
|
||||
required
|
||||
/>
|
||||
</Field>
|
||||
<Field
|
||||
label="Body"
|
||||
htmlFor="body"
|
||||
hint="This will be sent as HTML."
|
||||
>
|
||||
{/* Hidden field so your existing FormData submit keeps working */}
|
||||
<input type="hidden" id="body" name="body" value={bodyHtml} />
|
||||
|
||||
<Button type="submit" disabled={submitting}>
|
||||
{submitting ? "Sending…" : showSuccess ? "Success" : "Send"}
|
||||
</Button>
|
||||
<RichTextEditor
|
||||
value={bodyHtml}
|
||||
onChange={setBodyHtml}
|
||||
placeholder="Write your message…"
|
||||
className="rounded-md border border-zinc-800 bg-zinc-950/60"
|
||||
/>
|
||||
</Field>
|
||||
|
||||
<div className="rounded-md border border-zinc-800 bg-zinc-950/60 p-3">
|
||||
<div className="text-xs font-medium text-zinc-400">Response</div>
|
||||
<pre className="mt-2 overflow-x-auto text-xs text-zinc-200">
|
||||
<Button type="submit" disabled={submitting}>
|
||||
{submitting ? "Sending…" : showSuccess ? "Success" : "Send"}
|
||||
</Button>
|
||||
|
||||
<div className="rounded-md border border-zinc-800 bg-zinc-950/60 p-3">
|
||||
<div className="text-xs font-medium text-zinc-400">Response</div>
|
||||
<pre className="mt-2 overflow-x-auto text-xs text-zinc-200">
|
||||
{result ? JSON.stringify(result, null, 2) : "No response yet."}
|
||||
</pre>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
"use client";
|
||||
|
||||
import dynamic from "next/dynamic";
|
||||
import type React from "react";
|
||||
|
||||
import "react-quill/dist/quill.snow.css";
|
||||
|
||||
const ReactQuill = dynamic(() => import("react-quill"), { ssr: false });
|
||||
|
||||
type RichTextEditorProps = {
|
||||
value: string;
|
||||
onChange: (html: string) => void;
|
||||
placeholder?: string;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
export default function RichTextEditor({
|
||||
value,
|
||||
onChange,
|
||||
placeholder,
|
||||
className,
|
||||
}: RichTextEditorProps) {
|
||||
return (
|
||||
<div className={className}>
|
||||
<div className="bb-quill">
|
||||
<ReactQuill
|
||||
theme="snow"
|
||||
value={value}
|
||||
onChange={onChange}
|
||||
placeholder={placeholder}
|
||||
modules={{
|
||||
toolbar: [
|
||||
[{ header: [1, 2, 3, false] }],
|
||||
["bold", "italic", "underline", "strike"],
|
||||
[{ color: [] }, { background: [] }],
|
||||
[{ list: "ordered" }, { list: "bullet" }],
|
||||
["blockquote", "code-block"],
|
||||
["link"],
|
||||
["clean"],
|
||||
],
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { sendEmailAction, type ApiResponse, type EmailRequest } from "/app/actions/sendEmail";
|
||||
import { Button, Field, Input } from "@/components/ui/form";
|
||||
import RichTextEditor from "@/components/ui/RichTextEditor";
|
||||
|
||||
export default function SendEmailForm(): JSX.Element {
|
||||
const [result, setResult] = useState<
|
||||
ApiResponse<EmailRequest> | { error: string } | null
|
||||
>(null);
|
||||
const [submitting, setSubmitting] = useState(false);
|
||||
|
||||
const [showSuccess, setShowSuccess] = useState(false);
|
||||
const successTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||
|
||||
const [bodyHtml, setBodyHtml] = useState<string>("");
|
||||
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
if (successTimerRef.current) clearTimeout(successTimerRef.current);
|
||||
};
|
||||
}, []);
|
||||
|
||||
async function onSubmit(e: React.FormEvent<HTMLFormElement>): Promise<void> {
|
||||
e.preventDefault();
|
||||
setResult(null);
|
||||
|
||||
setShowSuccess(false);
|
||||
if (successTimerRef.current) clearTimeout(successTimerRef.current);
|
||||
|
||||
const form = new FormData(e.currentTarget);
|
||||
|
||||
const recipient = String(form.get("recipient") ?? "");
|
||||
const subject = String(form.get("subject") ?? "");
|
||||
const body = String(form.get("body") ?? ""); // HTML from hidden input
|
||||
|
||||
try {
|
||||
setSubmitting(true);
|
||||
const data = await sendEmailAction({ recipient, subject, body });
|
||||
setResult(data);
|
||||
|
||||
if (data?.success === true) {
|
||||
setShowSuccess(true);
|
||||
|
||||
successTimerRef.current = setTimeout(() => {
|
||||
setShowSuccess(false);
|
||||
setResult(null);
|
||||
}, 2000);
|
||||
}
|
||||
} catch (err) {
|
||||
const message = err instanceof Error ? err.message : "Unknown error";
|
||||
setResult({ error: message });
|
||||
} finally {
|
||||
setSubmitting(false);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="mx-auto w-full max-w-xl px-4 py-10 text-zinc-50">
|
||||
<h1 className="text-2xl font-semibold tracking-tight">
|
||||
Send <span className="text-amber-300">Email</span>
|
||||
</h1>
|
||||
<p className="mt-2 text-sm text-zinc-400">
|
||||
Compose a message and send it from the admin panel.
|
||||
</p>
|
||||
|
||||
<form onSubmit={onSubmit} className="mt-6 space-y-4">
|
||||
{result && "error" in result && (
|
||||
<div className="rounded-md border border-red-500/40 bg-red-500/10 px-3 py-2 text-sm text-red-200">
|
||||
{result.error}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<Field label="Recipient" htmlFor="recipient">
|
||||
<Input
|
||||
id="recipient"
|
||||
name="recipient"
|
||||
type="email"
|
||||
placeholder="user@example.com"
|
||||
defaultValue="user@example.com"
|
||||
required
|
||||
/>
|
||||
</Field>
|
||||
|
||||
<Field label="Subject" htmlFor="subject">
|
||||
<Input
|
||||
id="subject"
|
||||
name="subject"
|
||||
placeholder="Subject…"
|
||||
defaultValue="Test subject"
|
||||
required
|
||||
/>
|
||||
</Field>
|
||||
|
||||
<Field
|
||||
label="Body"
|
||||
htmlFor="body"
|
||||
hint="This will be sent as HTML."
|
||||
>
|
||||
{/* Hidden field so your existing FormData submit keeps working */}
|
||||
<input type="hidden" id="body" name="body" value={bodyHtml} />
|
||||
|
||||
<RichTextEditor
|
||||
value={bodyHtml}
|
||||
onChange={setBodyHtml}
|
||||
placeholder="Write your message…"
|
||||
className="rounded-md border border-zinc-800 bg-zinc-950/60"
|
||||
/>
|
||||
</Field>
|
||||
|
||||
<Button type="submit" disabled={submitting}>
|
||||
{submitting ? "Sending…" : showSuccess ? "Success" : "Send"}
|
||||
</Button>
|
||||
|
||||
<div className="rounded-md border border-zinc-800 bg-zinc-950/60 p-3">
|
||||
<div className="text-xs font-medium text-zinc-400">Response</div>
|
||||
<pre className="mt-2 overflow-x-auto text-xs text-zinc-200">
|
||||
{result ? JSON.stringify(result, null, 2) : "No response yet."}
|
||||
</pre>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
export function formatDate(value: unknown) {
|
||||
if (!value) return "—";
|
||||
const d = new Date(value as any);
|
||||
return Number.isNaN(d.getTime()) ? "—" : d.toLocaleString();
|
||||
}
|
||||
Generated
+218
-26
@@ -11,8 +11,10 @@
|
||||
"clsx": "^2.1.1",
|
||||
"lucide-react": "^0.555.0",
|
||||
"next": "14.2.3",
|
||||
"quill": "^2.0.3",
|
||||
"react": "18.3.1",
|
||||
"react-dom": "18.3.1"
|
||||
"react-dom": "18.3.1",
|
||||
"react-quill": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "20.12.7",
|
||||
@@ -557,6 +559,21 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/quill": {
|
||||
"version": "1.3.10",
|
||||
"resolved": "https://registry.npmjs.org/@types/quill/-/quill-1.3.10.tgz",
|
||||
"integrity": "sha512-IhW3fPW+bkt9MLNlycw8u8fWb7oO7W5URC9MfZYHBlA24rex9rs23D5DETChu1zvgVdc5ka64ICjJOgQMr6Shw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"parchment": "^1.1.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/quill/node_modules/parchment": {
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/parchment/-/parchment-1.1.4.tgz",
|
||||
"integrity": "sha512-J5FBQt/pM2inLzg4hEWmzQx/8h8D0CiDxaG3vyp9rKrQRSDgBlhjdP5jQGgosEajXPSQouXGHOmVdgo7QmJuOg==",
|
||||
"license": "BSD-3-Clause"
|
||||
},
|
||||
"node_modules/@types/react": {
|
||||
"version": "18.3.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.3.tgz",
|
||||
@@ -1463,7 +1480,6 @@
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz",
|
||||
"integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.0",
|
||||
@@ -1482,7 +1498,6 @@
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
|
||||
"integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
@@ -1496,7 +1511,6 @@
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz",
|
||||
"integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.2",
|
||||
@@ -1610,6 +1624,15 @@
|
||||
"integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/clone": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz",
|
||||
"integrity": "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/clsx": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz",
|
||||
@@ -1770,6 +1793,26 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/deep-equal": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.2.tgz",
|
||||
"integrity": "sha512-5tdhKF6DbU7iIzrIOa1AOUt39ZRm13cmL1cGEh//aqR8x9+tNfbywRf0n5FD/18OKMdo7DNEtrX2t22ZAkI+eg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"is-arguments": "^1.1.1",
|
||||
"is-date-object": "^1.0.5",
|
||||
"is-regex": "^1.1.4",
|
||||
"object-is": "^1.1.5",
|
||||
"object-keys": "^1.1.1",
|
||||
"regexp.prototype.flags": "^1.5.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/deep-is": {
|
||||
"version": "0.1.4",
|
||||
"resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",
|
||||
@@ -1781,7 +1824,6 @@
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz",
|
||||
"integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-define-property": "^1.0.0",
|
||||
@@ -1799,7 +1841,6 @@
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz",
|
||||
"integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"define-data-property": "^1.0.1",
|
||||
@@ -1857,7 +1898,6 @@
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
|
||||
"integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.1",
|
||||
@@ -1962,7 +2002,6 @@
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
|
||||
"integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
@@ -1972,7 +2011,6 @@
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
|
||||
"integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
@@ -2010,7 +2048,6 @@
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
|
||||
"integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0"
|
||||
@@ -2536,6 +2573,18 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/eventemitter3": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz",
|
||||
"integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/extend": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
|
||||
"integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/fast-deep-equal": {
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
|
||||
@@ -2543,6 +2592,12 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/fast-diff": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz",
|
||||
"integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==",
|
||||
"license": "Apache-2.0"
|
||||
},
|
||||
"node_modules/fast-glob": {
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz",
|
||||
@@ -2735,7 +2790,6 @@
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
|
||||
"integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
@@ -2766,7 +2820,6 @@
|
||||
"version": "1.2.3",
|
||||
"resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz",
|
||||
"integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
@@ -2786,7 +2839,6 @@
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
|
||||
"integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.2",
|
||||
@@ -2811,7 +2863,6 @@
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
|
||||
"integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"dunder-proto": "^1.0.1",
|
||||
@@ -2972,7 +3023,6 @@
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
|
||||
"integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
@@ -3021,7 +3071,6 @@
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz",
|
||||
"integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-define-property": "^1.0.0"
|
||||
@@ -3050,7 +3099,6 @@
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
|
||||
"integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
@@ -3063,7 +3111,6 @@
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz",
|
||||
"integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"has-symbols": "^1.0.3"
|
||||
@@ -3079,7 +3126,6 @@
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
|
||||
"integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"function-bind": "^1.1.2"
|
||||
@@ -3159,6 +3205,22 @@
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/is-arguments": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.2.0.tgz",
|
||||
"integrity": "sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bound": "^1.0.2",
|
||||
"has-tostringtag": "^1.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/is-array-buffer": {
|
||||
"version": "3.0.5",
|
||||
"resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz",
|
||||
@@ -3304,7 +3366,6 @@
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz",
|
||||
"integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bound": "^1.0.2",
|
||||
@@ -3453,7 +3514,6 @@
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz",
|
||||
"integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bound": "^1.0.2",
|
||||
@@ -3801,6 +3861,31 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/lodash": {
|
||||
"version": "4.17.21",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/lodash-es": {
|
||||
"version": "4.17.21",
|
||||
"resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz",
|
||||
"integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/lodash.clonedeep": {
|
||||
"version": "4.5.0",
|
||||
"resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz",
|
||||
"integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/lodash.isequal": {
|
||||
"version": "4.5.0",
|
||||
"resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz",
|
||||
"integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==",
|
||||
"deprecated": "This package is deprecated. Use require('node:util').isDeepStrictEqual instead.",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/lodash.merge": {
|
||||
"version": "4.6.2",
|
||||
"resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
|
||||
@@ -3840,7 +3925,6 @@
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
|
||||
"integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
@@ -4101,11 +4185,26 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/object-is": {
|
||||
"version": "1.1.6",
|
||||
"resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.6.tgz",
|
||||
"integrity": "sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.7",
|
||||
"define-properties": "^1.2.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/object-keys": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz",
|
||||
"integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
@@ -4279,6 +4378,12 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/parchment": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/parchment/-/parchment-3.0.0.tgz",
|
||||
"integrity": "sha512-HUrJFQ/StvgmXRcQ1ftY6VEZUq3jA2t9ncFN4F84J/vN0/FPpQF+8FKXb3l6fLces6q0uOHj6NJn+2xvZnxO6A==",
|
||||
"license": "BSD-3-Clause"
|
||||
},
|
||||
"node_modules/parent-module": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
|
||||
@@ -4578,6 +4683,35 @@
|
||||
],
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/quill": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/quill/-/quill-2.0.3.tgz",
|
||||
"integrity": "sha512-xEYQBqfYx/sfb33VJiKnSJp8ehloavImQ2A6564GAbqG55PGw1dAWUn1MUbQB62t0azawUS2CZZhWCjO8gRvTw==",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"eventemitter3": "^5.0.1",
|
||||
"lodash-es": "^4.17.21",
|
||||
"parchment": "^3.0.0",
|
||||
"quill-delta": "^5.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"npm": ">=8.2.3"
|
||||
}
|
||||
},
|
||||
"node_modules/quill-delta": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/quill-delta/-/quill-delta-5.1.0.tgz",
|
||||
"integrity": "sha512-X74oCeRI4/p0ucjb5Ma8adTXd9Scumz367kkMK5V/IatcX6A0vlgLgKbzXWy5nZmCGeNJm2oQX0d2Eqj+ZIlCA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"fast-diff": "^1.3.0",
|
||||
"lodash.clonedeep": "^4.5.0",
|
||||
"lodash.isequal": "^4.5.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 12.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/react": {
|
||||
"version": "18.3.1",
|
||||
"resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz",
|
||||
@@ -4610,6 +4744,67 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/react-quill": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/react-quill/-/react-quill-2.0.0.tgz",
|
||||
"integrity": "sha512-4qQtv1FtCfLgoD3PXAur5RyxuUbPXQGOHgTlFie3jtxp43mXDtzCKaOgQ3mLyZfi1PUlyjycfivKelFhy13QUg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/quill": "^1.3.10",
|
||||
"lodash": "^4.17.4",
|
||||
"quill": "^1.3.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16 || ^17 || ^18",
|
||||
"react-dom": "^16 || ^17 || ^18"
|
||||
}
|
||||
},
|
||||
"node_modules/react-quill/node_modules/eventemitter3": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-2.0.3.tgz",
|
||||
"integrity": "sha512-jLN68Dx5kyFHaePoXWPsCGW5qdyZQtLYHkxkg02/Mz6g0kYpDx4FyP6XfArhQdlOC4b8Mv+EMxPo/8La7Tzghg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/react-quill/node_modules/fast-diff": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.1.2.tgz",
|
||||
"integrity": "sha512-KaJUt+M9t1qaIteSvjc6P3RbMdXsNhK61GRftR6SNxqmhthcd9MGIi4T+o0jD8LUSpSnSKXE20nLtJ3fOHxQig==",
|
||||
"license": "Apache-2.0"
|
||||
},
|
||||
"node_modules/react-quill/node_modules/parchment": {
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/parchment/-/parchment-1.1.4.tgz",
|
||||
"integrity": "sha512-J5FBQt/pM2inLzg4hEWmzQx/8h8D0CiDxaG3vyp9rKrQRSDgBlhjdP5jQGgosEajXPSQouXGHOmVdgo7QmJuOg==",
|
||||
"license": "BSD-3-Clause"
|
||||
},
|
||||
"node_modules/react-quill/node_modules/quill": {
|
||||
"version": "1.3.7",
|
||||
"resolved": "https://registry.npmjs.org/quill/-/quill-1.3.7.tgz",
|
||||
"integrity": "sha512-hG/DVzh/TiknWtE6QmWAF/pxoZKYxfe3J/d/+ShUWkDvvkZQVTPeVmUJVu1uE6DDooC4fWTiCLh84ul89oNz5g==",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"clone": "^2.1.1",
|
||||
"deep-equal": "^1.0.1",
|
||||
"eventemitter3": "^2.0.3",
|
||||
"extend": "^3.0.2",
|
||||
"parchment": "^1.1.4",
|
||||
"quill-delta": "^3.6.2"
|
||||
}
|
||||
},
|
||||
"node_modules/react-quill/node_modules/quill-delta": {
|
||||
"version": "3.6.3",
|
||||
"resolved": "https://registry.npmjs.org/quill-delta/-/quill-delta-3.6.3.tgz",
|
||||
"integrity": "sha512-wdIGBlcX13tCHOXGMVnnTVFtGRLoP0imqxM696fIPwIf5ODIYUHIvHbZcyvGlZFiFhK5XzDC2lpjbxRhnM05Tg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"deep-equal": "^1.0.1",
|
||||
"extend": "^3.0.2",
|
||||
"fast-diff": "1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/read-cache": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz",
|
||||
@@ -4660,7 +4855,6 @@
|
||||
"version": "1.5.4",
|
||||
"resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz",
|
||||
"integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.8",
|
||||
@@ -4873,7 +5067,6 @@
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz",
|
||||
"integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"define-data-property": "^1.1.4",
|
||||
@@ -4891,7 +5084,6 @@
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz",
|
||||
"integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"define-data-property": "^1.1.4",
|
||||
|
||||
+3
-1
@@ -12,8 +12,10 @@
|
||||
"clsx": "^2.1.1",
|
||||
"lucide-react": "^0.555.0",
|
||||
"next": "14.2.3",
|
||||
"quill": "^2.0.3",
|
||||
"react": "18.3.1",
|
||||
"react-dom": "18.3.1"
|
||||
"react-dom": "18.3.1",
|
||||
"react-quill": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "20.12.7",
|
||||
|
||||
Reference in New Issue
Block a user