// eslint-disable-next-line @typescript-eslint/no-unused-vars import React, { useCallback, useEffect, useState } from 'react'; // import styled from 'styled-components'; // import List from '../lib/List/List'; // import Avatar from '../lib/Avatar/Avatar'; // import ListItem from '../lib/List/ListItem'; // import Button from '../lib/Button/Button'; // import { ajax, UserData } from '../lib/List/mock'; // // const Wrap = styled.div` // display: flex; // flex-direction: column; // gap: 50px; // `; // // // 组件使用 // const Home: React.FC = () => { // // 按钮式加载更多 // const [data, setData] = useState([]); // const [isLoading, setLoading] = useState(false); // const [isLoadFinish, setLoadFinish] = useState(false); // // 分页式加载更多 // const [data2, setData2] = useState([]); // const [totalData, setTotalData] = useState(0); // const [isLoading2, setLoading2] = useState(false); // const [isLoadFinish2, setLoadFinish2] = useState(false); // // // 初始化数据 // useEffect(() => { // // 按钮时加载初始化数据 // setLoading(true); // ajax('/loadmore', 0, 5).then((res) => { // setLoading(false); // setData((state) => { // return [...state, ...res.data]; // }); // }); // // 分页式加载初始化数据 // setLoading2(true); // ajax('/paginate', 0, 5).then((res) => { // setLoading2(false); // setTotalData(res.total); // setData2((state) => { // return [...state, ...res.data]; // }); // }); // }, []); // // 加载更多回调函数 // const loadMore = useCallback(() => { // setLoading(true); // ajax('/loadmore', data.length, 5).then((res) => { // setLoading(false); // if (res.data[0]) { // setData((state) => { // return [...state, ...res.data]; // }); // } else { // setLoadFinish(true); // } // }); // }, [isLoading]); // // 分页的函数回调 // const paginateMore = useCallback((start: number) => { // setLoading2(true); // ajax('/paginate', start, 5).then((res) => { // setLoading2(false); // if (res.data[0]) { // setData2(() => { // return [...res.data]; // }); // } else { // setLoadFinish2(true); // } // }); // }, []); // return ( // // ( // } // title={{item.title}} // description={item.description} // actions={ // <> // // // // } // /> // )} // /> // ( // } // title={{item.title}} // description={item.description} // actions={ // <> // // // // } // /> // )} // /> // ( // } // title={{item.title}} // description={item.description} // actions={ // <> // // // // } // /> // )} // /> // // ); // }; // // export default Home;