From 94038e6c402d06e08ceddc9c45b5a902a27e71ef Mon Sep 17 00:00:00 2001 From: Noah Spannbauer Date: Sun, 1 Sep 2024 20:08:50 -0500 Subject: [PATCH] adding pilot --- app/package.json | 2 +- app/src/components/pilots/Pilots.tsx | 149 ++++++++++++++++++++++++--- package-lock.json | 8 +- 3 files changed, 137 insertions(+), 22 deletions(-) diff --git a/app/package.json b/app/package.json index ab09f4e..8716e3a 100644 --- a/app/package.json +++ b/app/package.json @@ -16,7 +16,7 @@ "@fortawesome/free-regular-svg-icons": "^6.5.2", "@fortawesome/free-solid-svg-icons": "^6.5.2", "@fortawesome/react-fontawesome": "^0.2.2", - "@noahspan/noahspan-components": "^0.6.3", + "@noahspan/noahspan-components": "^0.6.5", "axios": "^1.7.2", "framer-motion": "^11.1.7", "react": "^18.2.0", diff --git a/app/src/components/pilots/Pilots.tsx b/app/src/components/pilots/Pilots.tsx index 3aafbfc..cbf16cc 100644 --- a/app/src/components/pilots/Pilots.tsx +++ b/app/src/components/pilots/Pilots.tsx @@ -2,13 +2,19 @@ import { useState } from 'react'; import PilotForm from '../pilotForm/PilotForm'; import { Button, - Card, - PlusIcon, - Typography, + EllipsisVerticalIcon, + EyeIcon, + IconButton, Menu, - MenuItem, MenuHandler, - MenuList + MenuItem, + MenuList, + PenIcon, + PlusIcon, + Table, + TableColumnDef, + TrashIcon, + Typography } from '@noahspan/noahspan-components'; const Pilots: React.FC = () => { @@ -17,8 +23,127 @@ const Pilots: React.FC = () => { setIsDrawerOpen(!isDrawerOpen); }; + type Person = { + firstName: string; + lastName: string; + age: number; + visits: number; + status: string; + progress: number; + }; + + const data: Person[] = [ + { + firstName: 'tanner', + lastName: 'linsley', + age: 24, + visits: 100, + status: 'In Relationship', + progress: 50 + }, + { + firstName: 'tandy', + lastName: 'miller', + age: 40, + visits: 40, + status: 'Single', + progress: 80 + }, + { + firstName: 'joe', + lastName: 'dirte', + age: 45, + visits: 20, + status: 'Complicated', + progress: 10 + } + ]; + + const columns: TableColumnDef[] = [ + { + accessorKey: 'firstName', + header: 'First Name', + cell: ({ getValue }) => ( +
+ {getValue().charAt(0).toUpperCase() + + getValue().slice(1)} +
+ ) + }, + { + accessorKey: 'lastName', + header: 'Last Name', + cell: ({ getValue }) => ( +
+ {getValue().charAt(0).toUpperCase() + + getValue().slice(1)} +
+ ) + }, + { + accessorKey: 'age', + header: 'Age', + cellProps: { + className: 'text-right' + } + }, + { + accessorKey: 'visits', + header: 'Visits', + cellProps: { + className: 'text-right' + } + }, + { + accessorKey: 'status', + header: 'Status' + }, + { + accessorKey: 'progress', + header: 'Progress', + cellProps: { + className: 'text-right' + } + }, + { + id: 'actions', + header: 'Actions', + cellProps: { + className: 'text-center' + }, + cell: () => { + return ( + + +
+ + + +
+
+ + + + Edit + + + + View + +
+ + + Delete + +
+
+ ); + }, + enableSorting: false + } + ]; + return ( - //
Pilots @@ -33,16 +158,7 @@ const Pilots: React.FC = () => { Add Pilot - - -
- -
-
- - List Item 1 - -
+
= () => { onOpenCloseDrawer={onOpenCloseDrawer} />
- //
); }; diff --git a/package-lock.json b/package-lock.json index 4b900c4..74a7bf2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -76,7 +76,7 @@ "@fortawesome/free-regular-svg-icons": "^6.5.2", "@fortawesome/free-solid-svg-icons": "^6.5.2", "@fortawesome/react-fontawesome": "^0.2.2", - "@noahspan/noahspan-components": "^0.6.3", + "@noahspan/noahspan-components": "^0.6.5", "axios": "^1.7.2", "framer-motion": "^11.1.7", "react": "^18.2.0", @@ -3397,9 +3397,9 @@ "link": true }, "node_modules/@noahspan/noahspan-components": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/@noahspan/noahspan-components/-/noahspan-components-0.6.3.tgz", - "integrity": "sha512-/Al/SxtHY3BodSM1pzSSE4SPmdS6n1BMSBCHx/ksbl2mODJBDFGRSzD5YwFZcrn5OzrppZ6vUY0X2rvYKwW4NQ==", + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/@noahspan/noahspan-components/-/noahspan-components-0.6.5.tgz", + "integrity": "sha512-rqwjSWY1mKzqoWBCDNB3WfvLb43DVet2J7a64414wLU/uCrTn4Q3/zpZxtKSE1Squ/geub25AUN0Ke302/4KvQ==", "dependencies": { "@fortawesome/fontawesome-svg-core": "^6.5.2", "@fortawesome/free-brands-svg-icons": "^6.5.2",