- Specify votes per share, par value, and price per share to
- outline the financial characteristics of the Share Class.
+ Please provide the number of votes each share carries, mention
+ the par value, and state the price per share to describe the
+ financial features of the share class.
@@ -296,7 +298,7 @@ const ShareClassForm = ({
Specify seniority, conversion rights, and participation cap
multiples to highlight conversion options and preferences for
- the Share Class.
+ the share class.
diff --git a/src/app/(authenticated)/(dashboard)/[publicId]/share-classes/page.tsx b/src/app/(authenticated)/(dashboard)/[publicId]/share-classes/page.tsx
index c3788b2d8..9502e5b68 100644
--- a/src/app/(authenticated)/(dashboard)/[publicId]/share-classes/page.tsx
+++ b/src/app/(authenticated)/(dashboard)/[publicId]/share-classes/page.tsx
@@ -1,27 +1,78 @@
-"use client";
import Link from "next/link";
-import { useParams } from "next/navigation";
+import { db } from "@/server/db";
+import ShareClassTable from "./table";
+import { Card } from "@/components/ui/card";
import { Button } from "@/components/ui/button";
+import type { ShareClass } from "@prisma/client";
+import { withServerSession } from "@/server/auth";
import EmptyState from "@/components/shared/empty-state";
import { RiPieChart2Line, RiAddFill } from "@remixicon/react";
-const SharesPage = () => {
- const params = useParams<{ publicId: string }>();
- const publicCompanyId = params.publicId;
+type SharesPageParams = {
+ params: {
+ publicId: string;
+ };
+};
+
+const getShareClasses = async (companyId: string) => {
+ return await db.shareClass.findMany({
+ where: { companyId },
+ });
+};
+
+const SharesPage = async ({ params }: SharesPageParams) => {
+ const { publicId } = params;
+ const session = await withServerSession();
+ const companyId = session?.user?.companyId;
+ let shareClasses: ShareClass[] = [];
+
+ if (companyId) {
+ shareClasses = await getShareClasses(companyId);
+ }
+
+ if (shareClasses.length === 0) {
+ return (
+ }
+ title="You do not have any share classes!"
+ subtitle="Please click the button below to create a new share class."
+ >
+
+
+
+
+ );
+ }
return (
- }
- title="You do not have any share classes!"
- subtitle="Please click the button below to create a new share class."
- >
-
-
-
-
+