'use strict';

const React = require("react");
const createReactClass = require("create-react-class");

module.exports = function ({dependencies}) {
	require("../abbreviated-item")({dependencies});
	
	dependencies.set("AstItemChild", createReactClass({
		displayName: "AstItemChild",
		render: function () {
			let AbbreviatedAstItem = dependencies.get("AbbreviatedAstItem");

			return (
				<div key={this.props.itemKey} className="child">
					<span className="name">{this.props.itemKey}</span>
					<div className="items">
						<span key={`${this.props.itemKey}`} className="item">
							<AbbreviatedAstItem data={this.props.value} />
						</span>
					</div>
				</div>
			);
		}
	}));
};
