Skip to content

Commit

Permalink
Merge pull request #36 from edipoarg/feature/connect-authorities-to-s…
Browse files Browse the repository at this point in the history
…creen

Feature/connect authorities to screen
  • Loading branch information
alexaiconejo authored Jul 4, 2024
2 parents 095c41e + 095d701 commit c9a06dc
Show file tree
Hide file tree
Showing 3 changed files with 28,349 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/Screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
} from "../models/models";
import styles from "../styles/Screen.module.css";
import { Link } from "react-router-dom";
import cargos from "../data/cargos.json";

// Función para recortar texto si supera el límite de caracteres
const truncateText = (text: string | null, maxLength: number): string => {
Expand Down Expand Up @@ -35,12 +36,17 @@ const getScreenDataForCase = (caso: Caso | null): ScreenData => {
const title = caso?.properties.Nombre ?? "Elegí una dependencia o un caso";
if (caso !== null) {
if (casoIsCasoDependencia(caso)) {
const oficialAsociado = cargos.find((cargo) => {
return cargo.C_Dependencia === caso.properties.Nombre;
});
return {
title,
caseId: caso.properties.Contador,
level: caso.properties.Dependencia,
address: caso.properties.Dirección,
phone: caso.properties.Teléfono,
grade: oficialAsociado?.C_GRADO,
authority: oficialAsociado?.C_Efectivo_AyN,
};
} else if (casoIsCasoGatillo(caso)) {
return {
Expand Down
Loading

0 comments on commit c9a06dc

Please sign in to comment.