Connected frontend shipments to backend

This commit is contained in:
GotthardG
2024-10-25 10:43:17 +02:00
parent b6611fdac0
commit 2a4f2d1d85
20 changed files with 801 additions and 252 deletions
+8
View File
@@ -0,0 +1,8 @@
// components/HomePage.tsx
import React from 'react';
const HomeView: React.FC = () => {
return <div>Welcome to the Home Page</div>;
};
export default HomeView;
+10
View File
@@ -0,0 +1,10 @@
// Planning.tsx
import React from 'react';
import CustomCalendar from '../components/Calendar.tsx';
const PlanningView: React.FC = () => {
return <CustomCalendar />;
//return <div>Welcome to the Planning Page</div>;
};
export default PlanningView;
+8
View File
@@ -0,0 +1,8 @@
// components/ResultView.tsx
import React from 'react';
const ResultsView: React.FC = () => {
return <div>Results page</div>;
};
export default ResultsView;
+44
View File
@@ -0,0 +1,44 @@
import React, { useState } from 'react';
import ShipmentPanel from '../components/ShipmentPanel';
import { Shipment } from '../types';
const ShipmentView: React.FC = () => {
//const [isCreatingShipment, setIsCreatingShipment] = useState(false);
//const [newShipment, setNewShipment] = useState<Shipment>({
// shipment_id: '',
// shipment_name: '',
// shipment_status: '',
// number_of_dewars: 0,
// shipment_date: '',
// contact_person: null,
// dewars: [],
// return_address: [],
// proposal_number: undefined,
// comments: '',
//});
const selectShipment = (shipment: Shipment | null) => {
console.log('Selected Shipment:', shipment);
// Additional logic for selected shipment
};
return (
<div style={{ display: 'flex', padding: '16px' }}>
{/* Shipment Panel on the left side */}
<ShipmentPanel
selectedPage="shipments"
//setIsCreatingShipment={setIsCreatingShipment}
//newShipment={newShipment}
//setNewShipment={setNewShipment}
selectShipment={selectShipment}
sx={{ width: '300px' }} // Adjust width as needed
/>
{/* Additional content can go here */}
<div style={{ marginLeft: '16px', flexGrow: 1 }}>
{/* Other components or information related to selected shipment can go here */}
</div>
</div>
);
};
export default ShipmentView;