import _extends from "@babel/runtime/helpers/esm/extends";
import React from 'react';
import { Geometry, Material } from '../components';
export default function Mixin(props) {
  var id = props.id,
      className = props.className,
      material = props.material,
      geometry = props.geometry,
      children = props.children;
  var defaultKeys = ['id', 'className', 'material', 'geometry', 'children'];
  var extraKeys = Object.keys(props).filter(function (key) {
    return !defaultKeys.includes(key);
  });
  var extraProps = extraKeys.reduce(function (acc, key) {
    var _extends2;

    return _extends({}, acc, (_extends2 = {}, _extends2[key] = props[key], _extends2));
  }, {});
  return /*#__PURE__*/React.createElement("a-mixin", _extends({
    id: id,
    class: className,
    material: material && new Material(material).toString(),
    geometry: geometry && new Geometry(geometry).toString()
  }, extraProps), children);
}