Add MVP version
This commit is contained in:
31
apps/web/src/app/(dashboard)/emails/email-list.tsx
Normal file
31
apps/web/src/app/(dashboard)/emails/email-list.tsx
Normal file
@@ -0,0 +1,31 @@
|
||||
"use client";
|
||||
|
||||
import Link from "next/link";
|
||||
import { api } from "~/trpc/react";
|
||||
|
||||
export default function DomainsList() {
|
||||
const emailsQuery = api.email.emails.useQuery();
|
||||
|
||||
return (
|
||||
<div className="mt-10">
|
||||
<div className="flex flex-col gap-2 w-full">
|
||||
{!emailsQuery.isLoading && emailsQuery.data?.length ? (
|
||||
emailsQuery.data?.map((email) => (
|
||||
<Link key={email.id} href={`/email/${email.id}`} className="w-full">
|
||||
<div className="p-2 px-4 border rounded-lg flex justify-between w-full">
|
||||
<p>{email.to}</p>
|
||||
<p className=" capitalize">
|
||||
{email.latestStatus?.toLowerCase()}
|
||||
</p>
|
||||
<p>{email.subject}</p>
|
||||
<p>{email.createdAt.toLocaleDateString()}</p>
|
||||
</div>
|
||||
</Link>
|
||||
))
|
||||
) : (
|
||||
<div>No domains</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
13
apps/web/src/app/(dashboard)/emails/page.tsx
Normal file
13
apps/web/src/app/(dashboard)/emails/page.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import type { Metadata } from "next";
|
||||
import EmailList from "./email-list";
|
||||
|
||||
export default async function EmailsPage() {
|
||||
return (
|
||||
<div>
|
||||
<div className="flex justify-between items-center">
|
||||
<h1 className="font-bold text-lg">Emails</h1>
|
||||
</div>
|
||||
<EmailList />
|
||||
</div>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user