fix(types): InventoryView - explicit NetObject type on map callback
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { AppLayout } from '../components/AppLayout';
|
||||
import { fetchObjects } from '../lib/api';
|
||||
import type { ViewKey } from '../types';
|
||||
import type { NetObject, ViewKey } from '../types';
|
||||
|
||||
export function InventoryView({ onNavigate }: { onNavigate: (v: ViewKey) => void }) {
|
||||
const [objects, setObjects] = useState<Awaited<ReturnType<typeof fetchObjects>>>([]);
|
||||
const [objects, setObjects] = useState<NetObject[]>([]);
|
||||
|
||||
useEffect(() => {
|
||||
fetchObjects().then(setObjects);
|
||||
@@ -32,7 +32,7 @@ export function InventoryView({ onNavigate }: { onNavigate: (v: ViewKey) => void
|
||||
<td colSpan={5} className="empty">Nessun oggetto</td>
|
||||
</tr>
|
||||
)}
|
||||
{objects.map(o => (
|
||||
{objects.map((o: NetObject) => (
|
||||
<tr key={o.id}>
|
||||
<td>{o.name}</td>
|
||||
<td>{o.type}</td>
|
||||
|
||||
Reference in New Issue
Block a user