xuchang-new/src/components/Container.jsx

24 lines
568 B
React
Raw Normal View History

2023-11-09 13:36:21 +08:00
import { useEffect, useRef } from 'react';
import useIcon from '../hooks/useIcon';
2023-11-09 15:34:52 +08:00
import cls from './container.module.scss';
2023-11-09 13:36:21 +08:00
const Container = (props) => {
let icon = useIcon(props.icon);
return (
<div className={`${cls.container} ${props.className}`} style={props.style}>
<div className={cls.container__head}>
<img
src={icon}
alt="#"
className={props.icon == 'kiln' ? cls.bigger : ''}
/>
<h2>{props.title}</h2>
</div>
<div className={cls.container__content}>{props.children}</div>
</div>
);
};
export default Container;