Im doing a web using astro, tailwind css and nodejs
<code>---
import { useEffect, useState } from 'react';
interface Animal {
address: string;
streets: string;
details: string;
imageUrl: { data: Uint8Array };
}
---
<div>
<h1>Datos de Animales</h1>
<div id="data">
{animals.length === 0 ? (
<p>No hay datos disponibles.</p>
) : (
animals.map((animal, index) => (
<div key={index}>
<p>Dirección: {animal.address}</p>
<p>Entre Calles: {animal.streets}</p>
<p>Detalles: {animal.details}</p>
<p>
Imagen:
<img
src={`data:image/jpeg;base64,${btoa(
String.fromCharCode(...new Uint8Array(animal.imageUrl.data))
)}`}
alt="Animal"
/>
</p>
</div>
))
)}
</div>
</div>
</code>
<code>---
import { useEffect, useState } from 'react';
interface Animal {
address: string;
streets: string;
details: string;
imageUrl: { data: Uint8Array };
}
---
<div>
<h1>Datos de Animales</h1>
<div id="data">
{animals.length === 0 ? (
<p>No hay datos disponibles.</p>
) : (
animals.map((animal, index) => (
<div key={index}>
<p>Dirección: {animal.address}</p>
<p>Entre Calles: {animal.streets}</p>
<p>Detalles: {animal.details}</p>
<p>
Imagen:
<img
src={`data:image/jpeg;base64,${btoa(
String.fromCharCode(...new Uint8Array(animal.imageUrl.data))
)}`}
alt="Animal"
/>
</p>
</div>
))
)}
</div>
</div>
</code>
---
import { useEffect, useState } from 'react';
interface Animal {
address: string;
streets: string;
details: string;
imageUrl: { data: Uint8Array };
}
---
<div>
<h1>Datos de Animales</h1>
<div id="data">
{animals.length === 0 ? (
<p>No hay datos disponibles.</p>
) : (
animals.map((animal, index) => (
<div key={index}>
<p>Dirección: {animal.address}</p>
<p>Entre Calles: {animal.streets}</p>
<p>Detalles: {animal.details}</p>
<p>
Imagen:
<img
src={`data:image/jpeg;base64,${btoa(
String.fromCharCode(...new Uint8Array(animal.imageUrl.data))
)}`}
alt="Animal"
/>
</p>
</div>
))
)}
</div>
</div>
Cannot find name ‘animals’.ts(2304)
i dont know why i have this issue, and i have another one:
Type ‘{ children: any[]; key: any; }’ is not assignable to type ‘HTMLAttributes’.
Property ‘key’ does not exist on type ‘HTMLAttributes’.ts(2322)
if someone can help me tell me pls
New contributor
Nicolas Bock is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.