import { forwardRef } from "react"
import { TBodyProps } from "./interface"
import { css,} from "@emotion/react"
import { applyBoxStyle, deleteCssProps } from "../model/src"
import { useTheme } from "@mui/material"

export const TBody = forwardRef<HTMLTableSectionElement, TBodyProps>(
  (props, ref) => {
    const { ...otherProps } = props
    const theme = useTheme()
    return (
      <tbody
        css={css(applyBoxStyle(props,theme))}
        ref={ref}
        {...deleteCssProps(otherProps)}
      />
    )
  },
)

TBody.displayName = "TBody"
