Sha256: 84ae7065699fb58d00b283e6bb103de7fb6059a50a55a6441e9cff76dfdffce1

Contents?: true

Size: 1.24 KB

Versions: 1

Compression:

Stored size: 1.24 KB

Contents

<%= render component_tag(x: {data: x_data("appImagePicker", alpine_props), ":class": "hasImage && 'has-image'"}) do %>  
  <div class="picker-file-name" x-show="hasImage">
    <label x-text="name"></label>
  </div>
  <div class="picker-uploader" @image-uploader:load="setImage($event.detail.file)" x-ref="uploader">
    <%= render Coco::ImageUploader.new(
      **uploader_args,
      click: false) do %>
      <div class="picker-blank-state" x-show="!fileData">
        <% if blank_state_text? %>
          <div class="picker-placeholder-text">
            <%= blank_state_text %>
          </div>
        <% end %>
        <div class="picker-browse-trigger">
          <%= coco_button(theme: :secondary, click: "$parent.openPicker") do %>
            Browse your files
          <% end %>
        </div>
      </div>
      <div x-show="fileData" x-cloak>
        <img :src="fileData" class="picker-thumbnail">
      </div>
    <% end %>
  </div>
  <div class="picker-actions" x-show="hasImage">
    <%= coco_button(theme: :text_secondary, icon: :repeat, click: "$parent.replaceImage()") do %>
      Replace
    <% end %>

    <%= coco_button(theme: :text_negative, icon: :trash_2, click: "$parent.clearImage(false)") do %>
      Delete
    <% end %>
  </div>
<% end %>

  

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
coveragebook_components-0.5.0 app/components/coco/app/elements/image_picker/image_picker.html.erb