import styles from '../../styles/user/section.module.scss'
import { parseClassName } from '../../utils/utils.js'

export default function Section({ name, icon, children, validate, validateMsg }) {
  return <div className={styles['main']}>
    <h2 className={parseClassName(['marginb-p1', styles.title])}>{icon && icon}{'   '}{name}</h2>
    <div className={styles["child"]}>{children}</div>
    {validate && validateMsg && <button className={parseClassName(['exo-btn', styles['btn']])} onClick={validate}>{validateMsg}</button>}
  </div>
}