system-copyright-react/src/components/list/ListProj.tsx

40 lines
1.3 KiB
TypeScript
Raw Normal View History

2024-03-13 16:11:28 +08:00
import './list-proj.css'
import CardProj from "../card/CardProj.tsx";
import {useRef, MutableRefObject} from "react";
import {Input, Pagination} from 'antd';
import type {SearchProps} from 'antd/es/input/Search';
const {Search} = Input;
2024-03-13 19:01:21 +08:00
const onSearch: SearchProps['onSearch'] = (value, _e, info) => {
console.log(info?.source, value)
};
2024-03-13 16:11:28 +08:00
export default function ListProj() {
const listProjRef: MutableRefObject<HTMLDivElement | null> = useRef(null);
const listRef: MutableRefObject<HTMLDivElement | null> = useRef(null);
const domHeight = window.innerHeight - 301;
return (
<div className="list-proj" ref={listProjRef}>
<div className="top">
<Search placeholder="按项目名搜索" onSearch={onSearch} style={{width: 200}}/>
</div>
<div className="body">
<div className="list" ref={listRef} style={{height: `${domHeight}px`}}>
<CardProj/>
<CardProj/>
<CardProj/>
<CardProj/>
<CardProj/>
<CardProj/>
</div>
<div className="page">
<Pagination defaultCurrent={1} total={50}/>
</div>
</div>
</div>
)
}