feat: models list

This commit is contained in:
jialin
2024-05-20 09:43:23 +08:00
parent c948110153
commit eeab170970
15 changed files with 328 additions and 56 deletions
+6
View File
@@ -0,0 +1,6 @@
.page-tools {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 70px;
}
+33
View File
@@ -0,0 +1,33 @@
import { useMemo } from 'react';
import styles from './index.less';
type PageToolsProps = {
left?: React.ReactNode;
right?: React.ReactNode;
marginBottom?: number;
marginTop?: number;
};
const PageTools: React.FC<PageToolsProps> = (props) => {
const { left, right, marginBottom, marginTop } = props;
const newStyle: Record<string, string> = useMemo(() => {
const style: Record<string, string> = {};
if (marginBottom) {
style.marginBottom = `${marginBottom}px`;
}
if (marginTop) {
style.marginTop = `${marginTop}px`;
}
return style;
}, [marginBottom, marginTop]);
return (
<div className={styles['page-tools']} style={newStyle}>
<div className="left">{left}</div>
<div className="right">{right}</div>
</div>
);
};
export default PageTools;