diff --git a/src/screens/InspectionFormScreen.tsx b/src/screens/InspectionFormScreen.tsx index bd3d030..70501b6 100644 --- a/src/screens/InspectionFormScreen.tsx +++ b/src/screens/InspectionFormScreen.tsx @@ -8,9 +8,9 @@ */ import { NativeStackScreenProps } from '@react-navigation/native-stack'; import React, { useCallback, useEffect, useState } from 'react'; -import { Alert, ScrollView, StyleSheet, Switch, Text, View } from 'react-native'; +import { Alert, ScrollView, StyleSheet, Switch, Text, TouchableOpacity, View } from 'react-native'; import { Template } from '../api/types'; -import { getTemplate } from '../db/repositories'; +import { getTemplates } from '../db/repositories'; import { createInspection } from '../sync/mutations'; import { RootStackParamList } from '../navigation/types'; import { @@ -75,7 +75,12 @@ function groupFields(fields: NormField[]): { group: string; items: NormField[] } const RESULTS = ['pass', 'fail', 'na'] as const; export function InspectionFormScreen({ route, navigation }: Props) { - const { featureId, featureName, templateId } = route.params; + const { featureId, featureName, templateId: suggestedId } = route.params; + + // Paso 1: elegir plantilla (las asignadas al proyecto llegan en el bundle). + // Paso 2: rellenar el formulario. `chosen` = false → aún en el selector. + const [available, setAvailable] = useState([]); + const [chosen, setChosen] = useState(false); const [template, setTemplate] = useState