'use client' import Link from 'next/link' import { useMemo } from 'react' import { useAdminConfig } from '../../../lib/use-admin-config' import { Button } from '../../../components/ui/button' import { Card, CardContent, CardHeader, CardTitle } from '../../../components/ui/card' export default function CollectionsPage() { const { runtime, config } = useAdminConfig() const collections = useMemo(() => { const runtimeCollections = runtime?.collections ?? [] if (runtimeCollections.length === 0) { return config.collections ?? [] } const configMap = new Map(config.collections.map((item) => [item.key, item])) return runtimeCollections.map((item) => ({ ...item, ...configMap.get(item.key) })) }, [runtime, config]) return (

Collections

Manage owneable data models configured in your Saaslib backend.

{collections.length === 0 ? (
No collections detected yet. Add an owneable controller to your backend to enable admin management.
) : (
{collections.map((collection) => ( {collection.label ?? collection.key}

{collection.description ?? 'Manage records from this collection.'}

))}
)}
) }