import { h, type FunctionComponent } from 'preact' import { useState } from 'preact/hooks' import rek from 'rek' import type { Object as ObjectType } from '../../../shared/types.ts' import usePromise from '../../shared/hooks/use_promise.ts' import Head from './head.ts' import Object from './object.tsx' import s from './results_page.module.scss' const ObjectsPage: FunctionComponent = () => { const objects = usePromise(() => rek('/api/objects')) const [currentObject, setCurrentObject] = useState(null) return (
: Objects

Objects

{objects.map((object) => ( ))}
{currentObject ? (

{currentObject}

) : null} ) } export default ObjectsPage