import clsx from 'clsx'
import { createStyles } from '../styles/use-styles'
import type { JSX } from 'solid-js/jsx-runtime'

export const Section = ({
  children,
  ...rest
}: JSX.IntrinsicElements['section']) => {
  const styles = createStyles()
  return (
    <section class={clsx(styles().section.main, rest.class)} {...rest}>
      {children}
    </section>
  )
}

export const SectionTitle = ({
  children,
  ...rest
}: JSX.IntrinsicElements['h3']) => {
  const styles = createStyles()
  return (
    <h3 class={clsx(styles().section.title, rest.class)} {...rest}>
      {children}
    </h3>
  )
}

export const SectionDescription = ({
  children,
  ...rest
}: JSX.IntrinsicElements['p']) => {
  const styles = createStyles()
  return (
    <p class={clsx(styles().section.description, rest.class)} {...rest}>
      {children}
    </p>
  )
}

export const SectionIcon = ({
  children,
  ...rest
}: JSX.IntrinsicElements['span']) => {
  const styles = createStyles()
  return (
    <span class={clsx(styles().section.icon, rest.class)} {...rest}>
      {children}
    </span>
  )
}
