'use client' import List from './list' import React, { useEffect, useState } from 'react' import useSWR from 'swr' import { fetchLog } from '@/service/common' const LogIndex = () => { const [page, setPage] = React.useState(0) const [limit, setLimit] = useState(10) const { data, mutate }: any = useSWR( { url: '/intentions/train_tasks', params: { page: page + 1, limit, }, }, fetchLog, ) const list: any = data?.data || [] const total = data?.total || 0 useEffect(() => { mutate() }, [page, limit]) return ( <>
) } export default LogIndex