<!--
~ Copyright (C) 2022 StApps
~ This program is free software: you can redistribute it and/or modify it
~ under the terms of the GNU General Public License as published by the Free
~ Software Foundation, version 3.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->

<ion-grid>
  <ion-row>
    <ion-col>
      <div class="ion-text-wrap">
        <ion-label class="title">{{ 'event.name' | thingTranslate: item }}</ion-label>
        <p>
          <ion-icon name="calendar_today"></ion-icon>
          @if (item.dates[0] && item.dates[item.dates.length - 1]) {
            <span>
              @if (item.repeatFrequency) {
                <span>
                  {{ item.repeatFrequency | durationLocalized: true | sentencecase }},
                  {{ item.dates[0] | dateFormat: 'weekday:long' }}
                </span>
              }
              <span>
                ({{ item.dates[0] | dateFormat }} - {{ item.dates[item.dates.length - 1] | dateFormat }})
              </span>
            </span>
          }
        </p>
        @if (item.event.type === 'academic event') {
          <ion-note>{{ 'categories' | thingTranslate: item.event | join: ', ' }}</ion-note>
        }
      </div>
    </ion-col>
    <ion-col width-20 text-right>
      @if (item.offers) {
        <stapps-offers-in-list [offers]="item.offers"></stapps-offers-in-list>
      }
    </ion-col>
  </ion-row>
</ion-grid>
