{% stories node with { title: 'Components/Node' } %}

{% story default with {
    name: '1. Default',
    args: { 
      node: {
        bundle: 'article',
        isPromoted: true,
        isSticky: false,
        isPublished: true
      },
      label: 'Sample Node Title',
      url: '/sample-node',
      view_mode: 'full',
      display_submitted: true,
      author_name: 'Admin',
      date: 'March 24, 2025',
      title_attributes: {},
      attributes: {},
      content_attributes: {},
      author_attributes: {},
      title_prefix: '',
      title_suffix: ''
    }
  } %}

{% set content %}
      <p>This is a sample node content with a structured layout.</p>
{% endset %}

  {% set attributes_image = create_attribute({
    src: 'TomFarley.png',
    alt: 'latest image',
    width: '200',
    height: '200',
}) %}


{% set image %}
   {% embed 'tailpine:image' with { attributes: attributes_image, style_name: 'medium'
  } %}{% endembed %}
{% endset %}

{% set url = '/user/1' %}

{% set image_formatter %}
  {% embed "tailpine:image-formatter" with { image: image, url: url } %}{% endembed %}
  {% endset %}

{% set attribute = create_attribute() %}

{% set author_picture %}
    {% embed 'tailpine:field' with {
      field_name: 'field_media_image',
      field_type: 'image',
      label: 'Image',
      label_display: 'hidden',
      label_hidden: true,
      items: [
        { content: image_formatter }
      ]
    } 
  %}{% endembed %}
{% endset %}


{% set term = [
  {
    bundle: "test",
    id: 3
  }
  ] 
%}

  {% set link_title %}
    {{ link('term 1', path('entity.taxonomy_term.canonical', {'taxonomy_term': 1})) }}
  {% endset %}
  
  {% set url = path('entity.taxonomy_term.canonical', {'taxonomy_term': 3}) %}
  {% set name = 'term 1' %}
  {% set content_term  %} 
    <p>This is just a label</p>
  {% endset %}

  {% set metadata %}
    {% embed 'tailpine:taxonomyterm' with { link_title: link_title, url: url, name: name, term: term, content: content_term} %}{% endembed %}
  {% endset %}



{% embed 'tailpine:node' with { 
    node: node,
    label: label,
    url: url,
    view_mode: view_mode,
    display_submitted: display_submitted,
    author_name: author_name,
    author_picture: author_picture,
    date: date,
    metadata: metadata,
    content: content,
    title_attributes: title_attributes,
    attributes: attributes,
    content_attributes: content_attributes,
    author_attributes: author_attributes,
    title_prefix: title_prefix,
    title_suffix: title_suffix
} %}{% endembed %}

{% endstory %}

{% endstories %}
