"use client" import { createClient } from "@/utils/supabase/client" import { Chip, Code, Skeleton } from "@heroui/react" import useSWR from "swr" export default function Page() { return } function CfgxList() { const noticeFetcher = async () => { const supabase = createClient() const { data /* , error */ } = await supabase .from("CFGX") .select( "created_at, updated_at, cfgx_version, title, description, version, author, content, alias_list, key_list, value_list", ) .order("created_at", { ascending: false }) return data as CfgxCardProps[] } const { data: cfgx /* , error */, isLoading } = useSWR( "/api/cfgx", noticeFetcher, ) if (isLoading) return [1, 2, 3].map((id) => (
)) return (
    {cfgx?.map((cfgx) => ( ))}
) } interface CfgxCardProps { created_at: string updated_at: string cfgx_version: string title: string description: string version: string author: string content: string alias_list?: { id: string info: string value: string } key_list?: { id: string info: string value: string } value_list?: { id: string info: string value: string } } function CfgxCard(props: CfgxCardProps) { return (
  • {props.title}

    {props.version} {props.author}

    {props.description}

    {props.content} {props.alias_list && (

    {props.alias_list.id} {props.alias_list.info} {props.alias_list.value}

    )}
  • ) }