React = require 'react' Package = require './package' class PackageSet extends React.Component @propTypes: 'title': React.PropTypes.string.isRequired 'packages': React.PropTypes.array.isRequired 'emptyText': React.PropTypes.string render: -> packages = @props.packages.map (pkg) -> count = ({@props.packages.length}) if packages.length is 0 count = [] packages.push(
{@props.emptyText ? "No packages to display."}
)

{@props.title} {count}

{ packages }
module.exports = PackageSet