import React, { ReactElement, useEffect } from 'react'; import Head from 'next/head' import DatePicker from "react-datepicker"; import "react-datepicker/dist/react-datepicker.css"; import dayjs from "dayjs"; import {useAppDispatch, useAppSelector} from "../../stores/hooks"; import {useRouter} from "next/router"; import { fetch } from '../../stores/organizations/organizationsSlice' import dataFormatter from '../../helpers/dataFormatter'; import LayoutAuthenticated from "../../layouts/Authenticated"; import {getPageTitle} from "../../config"; import SectionTitleLineWithButton from "../../components/SectionTitleLineWithButton"; import SectionMain from "../../components/SectionMain"; import CardBox from "../../components/CardBox"; import BaseButton from "../../components/BaseButton"; import BaseDivider from "../../components/BaseDivider"; import {mdiChartTimelineVariant} from "@mdi/js"; import {SwitchField} from "../../components/SwitchField"; import FormField from "../../components/FormField"; const OrganizationsView = () => { const router = useRouter() const dispatch = useAppDispatch() const { organizations } = useAppSelector((state) => state.organizations) const { id } = router.query; function removeLastCharacter(str) { console.log(str,`str`) return str.slice(0, -1); } useEffect(() => { dispatch(fetch({ id })); }, [dispatch, id]); return ( <>
Name
{organizations?.name}
Users Organizations
| First Name | Last Name | Phone Number | Disabled | |
|---|---|---|---|---|
| { item.firstName } | { item.lastName } | { item.phoneNumber } | { item.email } | { dataFormatter.booleanFormatter(item.disabled) } |
Human_resources organizations
| EmployeeName | Role | Salary |
|---|---|---|
| { item.employee_name } | { item.role } | { item.salary } |
Inventory organizations
| ItemName | Quantity | Status |
|---|---|---|
| { item.item_name } | { item.quantity } | { item.status } |
Machinery organizations
| MachineName | Model | MaintenanceSchedule | IsOperational |
|---|---|---|---|
| { item.machine_name } | { item.model } | { dataFormatter.dateTimeFormatter(item.maintenance_schedule) } | { dataFormatter.booleanFormatter(item.is_operational) } |
Quality_control organizations
| CheckName | CheckDate | Passed |
|---|---|---|
| { item.check_name } | { dataFormatter.dateTimeFormatter(item.check_date) } | { dataFormatter.booleanFormatter(item.passed) } |
Raw_materials organizations
| Name | Quantity | ReorderLevel |
|---|---|---|
| { item.name } | { item.quantity } | { item.reorder_level } |
Suppliers organizations
| SupplierName | ContactInfo | ContractTerms |
|---|---|---|
| { item.supplier_name } | { item.contact_info } | { item.contract_terms } |
Work_orders organizations
| OrderNumber | StartDate | EndDate |
|---|---|---|
| { item.order_number } | { dataFormatter.dateTimeFormatter(item.start_date) } | { dataFormatter.dateTimeFormatter(item.end_date) } |