{{!
  Copyright (c) HashiCorp, Inc.
  SPDX-License-Identifier: MPL-2.0
~}}

<div
  data-test-flex-masonry
  class="flex-masonry {{if @withSpacing "with-spacing"}} flex-masonry-columns-{{@columns}}"
  {{did-insert this.captureElement}}
  {{did-insert this.reflow}}
  {{did-update this.reflow @columns}}
  {{window-resize this.reflow}}>
  {{#each @items as |item|}}
    <div data-test-flex-masonry-item class="flex-masonry-item">
      {{yield item (action this.reflow)}}
    </div>
  {{/each}}
</div>
