style: 添加注释, 解构其他组件属性添加默认值

This commit is contained in:
CrescentLeaf
2025-04-18 23:25:47 +08:00
parent aba1202892
commit 1a2cfc424a
2 changed files with 13 additions and 4 deletions

View File

@@ -1,4 +1,8 @@
export default function MessageContainer({ children }) { /**
* 消息容器
* @returns { React.JSX.Element }
*/
export default function MessageContainer({ children, ...props } = {}) {
return ( return (
<div style={{ <div style={{
display: 'flex', display: 'flex',
@@ -7,8 +11,9 @@ export default function MessageContainer({ children }) {
alignItems: 'center', alignItems: 'center',
paddingTop: '10px', paddingTop: '10px',
paddingBottom: '14px' paddingBottom: '14px'
}}> }}
{...props}>
{children} {children}
</div> </div>
) )
} }

View File

@@ -1,4 +1,8 @@
export default function SystemMessage({ children }) { /**
* 一条系统提示消息
* @returns { React.JSX.Element }
*/
export default function SystemMessage({ children } = {}) {
return ( return (
<div style={{ <div style={{
width: '100%', width: '100%',