🚀 Initial commit: Versão atual do TrackSteel APP

This commit is contained in:
2026-03-18 21:17:53 +00:00
commit bde410c9ad
633 changed files with 108150 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
import { useQuery } from '@tanstack/react-query';
import { supabase } from '@/integrations/supabase/client';
export interface OFAtiva {
of_number: string;
descricao_resumida?: string;
cliente?: string;
gestor?: string;
}
export const useOFsAtivas = () => {
const { data: ofsAtivas = [], isLoading } = useQuery({
queryKey: ['ofs-ativas'],
queryFn: async () => {
const { data, error } = await supabase
.from('ficha_tecnica_contratos')
.select('of_number, descricao_resumida, cliente, gestor')
.not('of_number', 'is', null)
.order('of_number');
if (error) {
console.error('Erro ao buscar OFs ativas:', error);
throw error;
}
return data as OFAtiva[];
},
});
return {
ofsAtivas,
data: ofsAtivas, // Mantém compatibilidade com código existente
isLoading,
};
};