add
This commit is contained in:
parent
46db980b0c
commit
8ed1832a79
|
@ -60,7 +60,7 @@ export const CourseSyllabus: React.FC<CourseSyllabusProps> = ({
|
|||
right: 0,
|
||||
top: isHeaderVisible ? "56px" : "0",
|
||||
}}
|
||||
className="fixed top-0 bottom-0 z-10 bg-white shadow-xl">
|
||||
className="fixed top-0 bottom-0 z-20 bg-white shadow-xl">
|
||||
{isOpen && (
|
||||
<div className="h-full flex flex-col">
|
||||
<SyllabusHeader onToggle={onToggle} />
|
||||
|
|
|
@ -2,7 +2,7 @@ import { Pagination, Empty, Skeleton } from "antd";
|
|||
import { courseDetailSelect, CourseDto, Prisma } from "@nice/common";
|
||||
import { api } from "@nice/client";
|
||||
import { DefaultArgs } from "@prisma/client/runtime/library";
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import React, { useEffect, useMemo, useState } from "react";
|
||||
interface PostListProps {
|
||||
params?: {
|
||||
page?: number;
|
||||
|
@ -12,8 +12,7 @@ interface PostListProps {
|
|||
};
|
||||
cols?: number;
|
||||
showPagination?: boolean;
|
||||
renderItem: (post: any) => React.ReactNode
|
||||
|
||||
renderItem: (post: any) => React.ReactNode;
|
||||
}
|
||||
interface PostPagnationProps {
|
||||
data: {
|
||||
|
@ -21,13 +20,12 @@ interface PostPagnationProps {
|
|||
totalPages: number;
|
||||
};
|
||||
isLoading: boolean;
|
||||
|
||||
}
|
||||
export default function PostList({
|
||||
params,
|
||||
cols = 3,
|
||||
showPagination = true,
|
||||
renderItem
|
||||
renderItem,
|
||||
}: PostListProps) {
|
||||
const [currentPage, setCurrentPage] = useState<number>(params?.page || 1);
|
||||
const { data, isLoading }: PostPagnationProps =
|
||||
|
@ -72,9 +70,9 @@ export default function PostList({
|
|||
{isLoading ? (
|
||||
<Skeleton paragraph={{ rows: 5 }}></Skeleton>
|
||||
) : (
|
||||
posts.map((post) => <div key={post.id}>
|
||||
{renderItem(post)}
|
||||
</div>)
|
||||
posts.map((post) => (
|
||||
<div key={post.id}>{renderItem(post)}</div>
|
||||
))
|
||||
)}
|
||||
</div>
|
||||
{showPagination && (
|
||||
|
@ -91,7 +89,6 @@ export default function PostList({
|
|||
</>
|
||||
) : (
|
||||
<div className="py-64">
|
||||
|
||||
<Empty description="暂无数据" />
|
||||
</div>
|
||||
)}
|
||||
|
|
Loading…
Reference in New Issue