import React, { useState, useRef, useEffect } from 'react'; import styled from 'styled-components'; import { useCallFeed } from '../hooks/useCallFeed'; import { Platform, Linking, View, ScrollView, Text, TouchableOpacity } from 'react-native'; import { PageHeader, PageFooter, } from './generalHelpers.jsx'; import { Ionicons } from '@expo/vector-icons'; import ActionSheet from 'react-native-actions-sheet'; const DepartmentActionSheet = styled(ActionSheet)``; export default function Incidents() { const actionSheetRef = useRef(null); const callFeed = useCallFeed(); const { departments, callIconMap, callDetails, callColorSelector, } = callFeed; const { departmentTypeMap, accountDetails, deptList, setDeptList, selectedDepartment, setSelectedDepartment, updateSelectedDepartment, selectedDepartmentColorPicker, } = departments; const { Incident, Address, Person, Response } = callDetails; const { CallThemes, InitList } = accountDetails; const { IncID, IncNumber, JurisdictionNumber, ServiceNumber, ServiceID, IncDate, IncNature, IncNatureCode, IncNatureCodeDesc, Notes, Status, Origin, } = Incident; const { StreetAddress, AddressApartment, Town, State, ZipCode, Latitude, Longitude, County, Intersection1, Intersection2, LocationName, WeatherCondition, } = Address; const { Name, Age, Gender, Statement, Conscious, Breathing, CallBackNumber, } = Person; const { Units } = Response; const { CriticalCallList, HighCallList, MediumCallList, LowCallList, } = CallThemes; return ( { actionSheetRef.current?.show(); }} > {selectedDepartment?.deptAbv} {deptList?.map((item) => { return ( { actionSheetRef.current?.hide(); return updateSelectedDepartment( selectedDepartment?.deptId, item?.deptId ) }} > {item?.dept} {item?.primary ? : null} {`${item?.deptAbv} - ${departmentTypeMap[item?.type]}`} ); })} ) }