diff --git a/src/screens/daily-report-page/stepComponent/manPower.js b/src/screens/daily-report-page/stepComponent/manPower.js new file mode 100644 index 0000000..86751f9 --- /dev/null +++ b/src/screens/daily-report-page/stepComponent/manPower.js @@ -0,0 +1,180 @@ +import { TouchableRipple, Card, Text, Avatar, Button, FAB } from 'react-native-paper'; +import { View, StyleSheet, ScrollView } from 'react-native'; +import React, { useState, useCallback, useRef } from 'react'; +import { colors } from '../../../utils/color' +import { strings } from '../../../utils/i18n' +import Icon from 'react-native-vector-icons/AntDesign'; +import moment from 'moment'; +import 'moment/locale/id'; +import person from '../../../assets/images/courier_man.png' +import { + BottomSheetModal, + BottomSheetModalProvider, + BottomSheetView, +} from '@gorhom/bottom-sheet'; +moment.locale('id'); +export default function ManpowerScreen({ route, navigation }) { + const bottomSheetModal = useRef(null); + const handleOpenSheet = useCallback(() => { + bottomSheetModal.current?.present(); + }, []); + const dummyData = [ + { id: '1', status: "Masuk", position: "Danru", name: "farhan", date: '2024-02-09', timeIn: '08:00', timeOut: '17:00', shift: "Pagi", duration: new Date(0, 0, 0, 8, 0, 0) }, + { id: '2', status: "Sakit", position: "Guard", name: "ibnu", date: '2024-02-10', timeIn: '08:15', timeOut: '17:30', shift: "Pagi", duration: new Date(0, 0, 0, 8, 30, 0) }, + { id: '3', status: "Izin", position: "Guard", name: "ardhi", date: '2024-02-11', timeIn: '08:10', timeOut: '17:20', shift: "Pagi", duration: new Date(0, 0, 0, 9, 0, 0) }, + { id: '4', status: "Cuti", position: "Admin", name: "hana", date: '2024-02-12', timeIn: '08:10', timeOut: '17:20', shift: "Pagi", duration: new Date(0, 0, 0, 10, 0, 0) }, + { id: '5', status: "Alpa", position: "Guard", name: "satori", date: '2024-02-13', timeIn: '08:10', timeOut: '17:20', shift: "Pagi", duration: new Date(0, 0, 0, 11, 0, 0) }, + { id: '6', status: "Cuti", position: "Guard", name: "khaidir", date: '2024-02-14', timeIn: '08:10', timeOut: '17:20', shift: "Pagi", duration: new Date(0, 0, 0, 9, 30, 0) }, + { id: '7', status: "Masuk", position: "Guard", name: "wahyu", date: '2024-02-15', timeIn: '08:10', timeOut: '17:20', shift: "Pagi", duration: new Date(0, 0, 0, 12, 0, 0) }, + ]; + + const getCardColor = (status) => { + switch (status) { + case 'Sakit': + return colors.mistBlue; + case 'Alpa': + return colors.semiRed; + case 'Izin': + return colors.semiYellow; + case 'Cuti': + return colors.amethystSmoke; + default: + return colors.mercury; + } + }; + + const getTextColor = (status) => { + switch (status) { + case 'Sakit': + return colors.white; + case 'Alpa': + return colors.beanRed; + case 'Izin': + return colors.orange; + case 'Cuti': + return colors.white; + default: + return colors.mistBlue; + } + }; + + const getTextStatusColor = (status) => { + switch (status) { + case 'Sakit': + return colors.mistBlue; + case 'Alpa': + return colors.beanRed; + case 'Izin': + return colors.orange; + case 'Cuti': + return colors.amethystSmoke; + default: + return colors.mercury; + } + }; + + return ( + <> + + {dummyData.map((item) => ( + + + + + + + {item.name} - + + + {item.position} + + + + + {item.status} + + + + + + + + ))} + + + + + { navigation.navigate('BKOScreen') }} + /> + + + + + + Persetujuan + + Apakah Data Sudah Sesuai? + + + + + + + + + + + ) +} + +const styles = StyleSheet.create({ + fab: { + position: 'absolute', + margin: 16, + right: 0, + bottom: 5, + backgroundColor: colors.semiBlue, + }, + status: { + backgroundColor: colors.semiBlue, + borderRadius: 10, + padding: 5, + }, + row: { + flexDirection: 'row', + alignItems: 'center', + marginBottom: 5, + }, + card: { + marginHorizontal: 10, + marginVertical: 4, + elevation: 4, + }, + cardContent: { + alignItems: 'center' + }, + row: { + flexDirection: 'row', + alignItems: 'center', + marginBottom: 5, + }, +}); \ No newline at end of file