/*
* 현장 탭 — 역할별 현장 기능 허브.
* 장치업체 → 현장 체크리스트(SCR-M1), 홀매니저 → 현장 검수(SCR-M2).
*/
import { Ionicons } from '@expo/vector-icons';
import { router } from 'expo-router';
import React from 'react';
import { Pressable, ScrollView, StyleSheet, Text, View } from 'react-native';
import { Banner } from '../../components/Banner';
import { useAuth } from '../../context/AuthContext';
import { colors, radius, spacing, type } from '../../theme';
export default function FieldScreen() {
const { activeWorkspace, user } = useAuth();
const role = activeWorkspace?.myRole;
const isHallManager = user?.hallManager || role === 'HALL_MANAGER';
const isContractor = role === 'CONTRACTOR';
return (
현장 업무
{!isContractor && !isHallManager ? (
현장 기능은 장치·시공업체(체크리스트)와 홀매니저(검수) 역할에서 제공됩니다.
) : null}
{isContractor ? (
router.push('/checklist')}
/>
) : null}
{isHallManager ? (
router.push('/inspection')}
/>
) : null}
);
}
function Tile({
icon,
title,
desc,
onPress,
}: {
icon: keyof typeof Ionicons.glyphMap;
title: string;
desc: string;
onPress: () => void;
}) {
return (
{title}
{desc}
);
}
const styles = StyleSheet.create({
scroll: { padding: spacing.md, gap: spacing.md },
title: { fontSize: type.h2.fontSize, fontWeight: '700', color: colors.neutral900 },
tile: {
flexDirection: 'row',
alignItems: 'center',
gap: 12,
backgroundColor: colors.white,
borderWidth: 1,
borderColor: colors.neutral200,
borderRadius: radius.md,
padding: spacing.md,
},
tileIcon: {
width: 44,
height: 44,
borderRadius: radius.sm,
backgroundColor: colors.primary050,
alignItems: 'center',
justifyContent: 'center',
},
tileBody: { flex: 1, gap: 2 },
tileTitle: { fontSize: type.h3.fontSize, fontWeight: '600', color: colors.neutral900 },
tileDesc: { fontSize: type.caption.fontSize, color: colors.neutral500 },
});