import { GET_JOB_BY_PK } from "@/graphql/jobs.queries";
import { useQuery } from "@apollo/client";
import { useLocalSearchParams } from "expo-router";
import React from "react";
import { useTranslation } from "react-i18next";
import {
RefreshControl,
ScrollView,
StyleSheet,
Text,
View,
} from "react-native";
import { ActivityIndicator, Card, useTheme } from "react-native-paper";
import DataLabelComponent from "../data-label/data-label";
export default function JobTombstone() {
const { jobId } = useLocalSearchParams();
const { loading, error, data, refetch } = useQuery(GET_JOB_BY_PK, {
variables: {
id: jobId,
},
skip: !jobId,
});
const theme = useTheme();
console.log("*** ~ JobTombstone ~ theme:", theme.colors);
const { t } = useTranslation();
const onRefresh = async () => {
return refetch();
};
if (loading) {
return ;
}
if (!data.jobs_by_pk) {
return (
Job is not defined.
);
}
const job = data.jobs_by_pk;
return (
}
>
{job.status}
{job.inproduction && (
{t("objects.jobs.labels.inproduction")}
)}
{job.inproduction &&
job.production_vars &&
!!job.production_vars.note && (
{job.production_vars.note}
)}
{`${job.v_model_yr || ""} ${job.v_make_desc || ""} ${
job.v_model_desc || ""
}`}
{job.v_vin}
}
/>
);
}
const localStyles = StyleSheet.create({
twoColumnCard: { display: "flex", flexDirection: "row" },
twoColumnCardColumn: { flex: 1 },
status: {
textAlign: "center",
flexDirection: "row",
justifyContent: "center",
},
inproduction: {
textAlign: "center",
flexDirection: "row",
justifyContent: "center",
},
});