-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: render share classes on a table (#112)
* feat: update share class page * feat: update share class form * feat: more updates to share class page * chore: make error message smaller and lighter * feat: create share class table * chore: update typeof ShareClass * fix: build warning about sharp
- Loading branch information
Showing
6 changed files
with
135 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 68 additions & 17 deletions
85
src/app/(authenticated)/(dashboard)/[publicId]/share-classes/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
src/app/(authenticated)/(dashboard)/[publicId]/share-classes/table.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { | ||
Table, | ||
TableBody, | ||
TableCell, | ||
TableHead, | ||
TableHeader, | ||
TableRow, | ||
} from "@/components/ui/table"; | ||
|
||
import { Card } from "@/components/ui/card"; | ||
import type { ShareClass } from "@prisma/client"; | ||
const formatter = new Intl.NumberFormat("en-US"); | ||
import { RiEqualizer2Line } from "@remixicon/react"; | ||
|
||
type ShareClassTableProps = { | ||
shareClasses: ShareClass[]; | ||
}; | ||
|
||
const ShareClassTable = ({ shareClasses }: ShareClassTableProps) => { | ||
return ( | ||
<Card> | ||
<Table className=""> | ||
<TableHeader> | ||
<TableRow> | ||
<TableHead>Name</TableHead> | ||
<TableHead>Type</TableHead> | ||
<TableHead>Authorized shares</TableHead> | ||
<TableHead>Board approval date</TableHead> | ||
<TableHead>Stockholder approval date</TableHead> | ||
<TableHead></TableHead> | ||
</TableRow> | ||
</TableHeader> | ||
<TableBody> | ||
{shareClasses.map((klass) => ( | ||
<TableRow key={klass.id} className="border-none"> | ||
<TableCell className="font-medium">{klass.name}</TableCell> | ||
<TableCell>{klass.classType}</TableCell> | ||
<TableCell> | ||
{formatter.format(klass.initialSharesAuthorized)} | ||
</TableCell> | ||
<TableCell>{`${new Date( | ||
klass.boardApprovalDate, | ||
).toLocaleDateString("en-US")}`}</TableCell> | ||
<TableCell>{`${new Date( | ||
klass.stockholderApprovalDate, | ||
).toLocaleDateString("en-US")}`}</TableCell> | ||
<TableCell> | ||
<RiEqualizer2Line className="h-5 w-5 cursor-pointer text-gray-500 hover:text-gray-700" /> | ||
</TableCell> | ||
</TableRow> | ||
))} | ||
</TableBody> | ||
</Table> | ||
</Card> | ||
); | ||
}; | ||
|
||
export default ShareClassTable; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters