adding pilot

This commit is contained in:
2024-09-01 20:08:50 -05:00
parent c175b34129
commit 94038e6c40
3 changed files with 137 additions and 22 deletions

View File

@@ -16,7 +16,7 @@
"@fortawesome/free-regular-svg-icons": "^6.5.2", "@fortawesome/free-regular-svg-icons": "^6.5.2",
"@fortawesome/free-solid-svg-icons": "^6.5.2", "@fortawesome/free-solid-svg-icons": "^6.5.2",
"@fortawesome/react-fontawesome": "^0.2.2", "@fortawesome/react-fontawesome": "^0.2.2",
"@noahspan/noahspan-components": "^0.6.3", "@noahspan/noahspan-components": "^0.6.5",
"axios": "^1.7.2", "axios": "^1.7.2",
"framer-motion": "^11.1.7", "framer-motion": "^11.1.7",
"react": "^18.2.0", "react": "^18.2.0",

View File

@@ -2,13 +2,19 @@ import { useState } from 'react';
import PilotForm from '../pilotForm/PilotForm'; import PilotForm from '../pilotForm/PilotForm';
import { import {
Button, Button,
Card, EllipsisVerticalIcon,
PlusIcon, EyeIcon,
Typography, IconButton,
Menu, Menu,
MenuItem,
MenuHandler, MenuHandler,
MenuList MenuItem,
MenuList,
PenIcon,
PlusIcon,
Table,
TableColumnDef,
TrashIcon,
Typography
} from '@noahspan/noahspan-components'; } from '@noahspan/noahspan-components';
const Pilots: React.FC<unknown> = () => { const Pilots: React.FC<unknown> = () => {
@@ -17,8 +23,127 @@ const Pilots: React.FC<unknown> = () => {
setIsDrawerOpen(!isDrawerOpen); 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 }) => (
<div>
{getValue<string>().charAt(0).toUpperCase() +
getValue<string>().slice(1)}
</div>
)
},
{
accessorKey: 'lastName',
header: 'Last Name',
cell: ({ getValue }) => (
<div>
{getValue<string>().charAt(0).toUpperCase() +
getValue<string>().slice(1)}
</div>
)
},
{
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 (
<Menu placement="bottom-end">
<MenuHandler>
<div>
<IconButton variant="text">
<EllipsisVerticalIcon size="xl" />
</IconButton>
</div>
</MenuHandler>
<MenuList>
<MenuItem className="flex gap-3">
<PenIcon size="lg" />
Edit
</MenuItem>
<MenuItem className="flex gap-3">
<EyeIcon size="lg" />
View
</MenuItem>
<hr className="my-3" />
<MenuItem className="flex gap-3">
<TrashIcon size="lg" />
Delete
</MenuItem>
</MenuList>
</Menu>
);
},
enableSorting: false
}
];
return ( return (
// <Card className="mt-6 p-6">
<div className="grid grid-cols-1 gap-4"> <div className="grid grid-cols-1 gap-4">
<div className="col-span-1"> <div className="col-span-1">
<Typography variant="h2">Pilots</Typography> <Typography variant="h2">Pilots</Typography>
@@ -33,16 +158,7 @@ const Pilots: React.FC<unknown> = () => {
<PlusIcon size="lg" /> <PlusIcon size="lg" />
Add Pilot Add Pilot
</Button> </Button>
<Menu placement="bottom-end"> <Table defaultData={data} columns={columns}></Table>
<MenuHandler>
<div>
<Button>Menu</Button>
</div>
</MenuHandler>
<MenuList>
<MenuItem>List Item 1</MenuItem>
</MenuList>
</Menu>
</div> </div>
<PilotForm <PilotForm
@@ -50,7 +166,6 @@ const Pilots: React.FC<unknown> = () => {
onOpenCloseDrawer={onOpenCloseDrawer} onOpenCloseDrawer={onOpenCloseDrawer}
/> />
</div> </div>
//</Card>
); );
}; };

8
package-lock.json generated
View File

@@ -76,7 +76,7 @@
"@fortawesome/free-regular-svg-icons": "^6.5.2", "@fortawesome/free-regular-svg-icons": "^6.5.2",
"@fortawesome/free-solid-svg-icons": "^6.5.2", "@fortawesome/free-solid-svg-icons": "^6.5.2",
"@fortawesome/react-fontawesome": "^0.2.2", "@fortawesome/react-fontawesome": "^0.2.2",
"@noahspan/noahspan-components": "^0.6.3", "@noahspan/noahspan-components": "^0.6.5",
"axios": "^1.7.2", "axios": "^1.7.2",
"framer-motion": "^11.1.7", "framer-motion": "^11.1.7",
"react": "^18.2.0", "react": "^18.2.0",
@@ -3397,9 +3397,9 @@
"link": true "link": true
}, },
"node_modules/@noahspan/noahspan-components": { "node_modules/@noahspan/noahspan-components": {
"version": "0.6.3", "version": "0.6.5",
"resolved": "https://registry.npmjs.org/@noahspan/noahspan-components/-/noahspan-components-0.6.3.tgz", "resolved": "https://registry.npmjs.org/@noahspan/noahspan-components/-/noahspan-components-0.6.5.tgz",
"integrity": "sha512-/Al/SxtHY3BodSM1pzSSE4SPmdS6n1BMSBCHx/ksbl2mODJBDFGRSzD5YwFZcrn5OzrppZ6vUY0X2rvYKwW4NQ==", "integrity": "sha512-rqwjSWY1mKzqoWBCDNB3WfvLb43DVet2J7a64414wLU/uCrTn4Q3/zpZxtKSE1Squ/geub25AUN0Ke302/4KvQ==",
"dependencies": { "dependencies": {
"@fortawesome/fontawesome-svg-core": "^6.5.2", "@fortawesome/fontawesome-svg-core": "^6.5.2",
"@fortawesome/free-brands-svg-icons": "^6.5.2", "@fortawesome/free-brands-svg-icons": "^6.5.2",