How to find the array name where a property does not exist?

I define the session name based on the array of objects in the data, and then it renders whether it is a session or an item. When rendering a session, if the session has the property ‘nome,’ it will display ‘section.nome,’ but not all sessions have the ‘nome’ property. I would like it so that if the ‘nome’ property does not exist in the session array, the name of that array is rendered instead. For instance, the section ‘horarioIntervalo’ does not have the property ‘nome’, so I would like it to render ‘horarioIntervalo’. Is it possible?

const data = [
  {
    _id: "64e502ec6b4bfaafb4e1466c",
    nome: "ESF Centro - Médico",
    endereco: {
      rua: "Angelo Perucchi, 30 - Centro",
    },
    fone: "48 3444 6065",
    especialidades: [
      {
        _id: "64e500d16b4bfaafb4e14667",
        nome: "Clínico Geral - Consulta",
        profissionais: [
          {
            _id: "6405d8f341fb166e83f43f5d",
            nome: "Braulio Portela",
            label: "Braulio Portela",
            value: "6405d8f341fb166e83f43f5d",
            horarioIntervalo: [
              {
                dias: [1, 2, 3, 4, 5],
                intervalo: {
                  inicio: "12:00",
                  fim: "13:00",
                },
              },
              {
                dias: [5],
                intervalo: {
                  inicio: "13:00",
                  fim: "17:00",
                },
              },
              {
                dias: [1, 2, 3, 4, 5],
                intervalo: {
                  inicio: "10:00",
                  fim: "11:40",
                },
              },
              {
                dias: [1, 2, 3, 4],
                intervalo: {
                  inicio: "15:00",
                  fim: "16:40",
                },
              },
              {
                dias: [5],
                intervalo: {
                  inicio: "13:00",
                  fim: "15:00",
                },
              },
            ],
            espacoAgendamento: "00:30",
            periodoAtendimento: {
              inicio: "2023-08-22",
              fim: "2023-12-31",
            },
          },
        ],
      },
    ],
  },
];
  function renderSection(section, sectionIndex, parentIndex) {
    const combinedIndex = `${parentIndex}-${sectionIndex}`;
    return (
      <div key={combinedIndex}>
        <div
          onClick={() => toggleSection(combinedIndex)}
          style={{
            cursor: "pointer",
            padding: "10px",
            border: "1px solid #ccc",
            background: selectedSections[combinedIndex] ? (parentIndex === sectionIndex ? "yellow" : "green") : parentIndex === sectionIndex ? "red" : "blue",
          }}>
          {section.nome}
        </div>
        {selectedSections[combinedIndex] && renderItems(section, combinedIndex)}
      </div>
    );
  }

  return <div>{data.map((section, index) => renderSection(section, index, index))}</div>;