<ion-content>
    <div class="content-container">
        <div class="heading-holder">
            <h2 class="main-header"> # Discover </h2>
        
            <section class="segments">
                <button [ngClass]="{'active' : selectedTab === 'news'}"
                (click)="selectedTab = 'news'"> News </button>
                <button [ngClass]="{'active' : selectedTab === 'videos'}"
                (click)="selectedTab = 'videos'"> Videos </button>
                <button [ngClass]="{'active' : selectedTab === 'exclusive'}"
                (click)="selectedTab = 'exclusive'"> Exclusive </button>
            </section>
        </div>
    
        <ion-slides  #slides [options]="slideOpts" *ngIf="selectedTab === 'news'">
            
            <ion-slide *ngFor="let news of newsData; let i = index">
                <div class="image-holder">
                    <figure>
                        <img [src]="news.image">
                    </figure>
    
                    <button *ngIf="news.type === 'VIDEO'">
                        <ion-icon name="play"></ion-icon>
                    </button>
    
                    <button *ngIf="news.type === 'ARTICLE'">
                        <ion-icon name="newspaper"></ion-icon>
                    </button>
                </div>
    
                <section class="content">
                    <h4> {{ news.heading }} </h4>
    
                    <div class="details" [innerHtml]="news.description">
                    </div>
                </section>           
    
                <section class="action-buttons">
                    <section class="shortcuts">
                        <button class="wide-button" (click)="news.isLiked = !news.isLiked"
                        [ngClass]="{'active' : news.isLiked}">
                            <ion-icon *ngIf="!news.isLiked" name="heart-outline"></ion-icon>
                            <ion-icon *ngIf="news.isLiked" name="heart"></ion-icon>
                            <span> {{ news.isLiked ? news.likes + 1 : news.likes }} </span>
                        </button>
    
                        <button>
                            <ion-icon name="share-social-outline"></ion-icon>
                        </button>
                    </section>                
    
                    <button class="read-more" (click)="showNewsDetails(news);"> 
                        <span> More </span>            
                        <ion-icon name="chevron-forward-outline"></ion-icon> 
                    </button>
                </section>
            </ion-slide>
        </ion-slides>

        <ion-slides #slides [options]="slideOpts" *ngIf="selectedTab === 'videos'">
            <ion-slide *ngFor="let news of videoData; let i = index">
                <div class="image-holder">
                    <figure>
                        <img [src]="news.image">
                    </figure>
    
                    <button *ngIf="news.type === 'VIDEO'">
                        <ion-icon name="play"></ion-icon>
                    </button>
    
                    <button *ngIf="news.type === 'ARTICLE'">
                        <ion-icon name="newspaper"></ion-icon>
                    </button>
                </div>
    
                <section class="content">
                    <h4> {{ news.heading }} </h4>
    
                    <div class="details" [innerHtml]="news.description">
                    </div>
                </section>           
    
                <section class="action-buttons">
                    <section class="shortcuts">
                        <button class="wide-button" (click)="news.isLiked = !news.isLiked"
                        [ngClass]="{'active' : news.isLiked}">
                            <ion-icon *ngIf="!news.isLiked" name="heart-outline"></ion-icon>
                            <ion-icon *ngIf="news.isLiked" name="heart"></ion-icon>
                            <span> {{ news.isLiked ? news.likes + 1 : news.likes }} </span>
                        </button>
    
                        <button>
                            <ion-icon name="share-social-outline"></ion-icon>
                        </button>
                    </section>                
    
                    <button class="read-more" (click)="showNewsDetails(news);"> 
                        <span> More </span>            
                        <ion-icon name="chevron-forward-outline"></ion-icon> 
                    </button>
                </section>
            </ion-slide>
        </ion-slides>


        <ion-slides #slides [options]="slideOpts" *ngIf="selectedTab === 'exclusive'">
            <ion-slide *ngFor="let news of exclusiveData; let i = index">
                <div class="image-holder">
                    <figure>
                        <img [src]="news.image">
                    </figure>
    
                    <button *ngIf="news.type === 'VIDEO'">
                        <ion-icon name="play"></ion-icon>
                    </button>
    
                    <button *ngIf="news.type === 'ARTICLE'">
                        <ion-icon name="newspaper"></ion-icon>
                    </button>
                </div>
    
                <section class="content">
                    <h4> {{ news.heading }} </h4>
    
                    <div class="details" [innerHtml]="news.description">
                    </div>
                </section>           
    
                <section class="action-buttons">
                    <section class="shortcuts">
                        <button class="wide-button" (click)="news.isLiked = !news.isLiked"
                        [ngClass]="{'active' : news.isLiked}">
                            <ion-icon *ngIf="!news.isLiked" name="heart-outline"></ion-icon>
                            <ion-icon *ngIf="news.isLiked" name="heart"></ion-icon>
                            <span> {{ news.isLiked ? news.likes + 1 : news.likes }} </span>
                        </button>
    
                        <button>
                            <ion-icon name="share-social-outline"></ion-icon>
                        </button>
                    </section>                
    
                    <button class="read-more" (click)="showNewsDetails(news);"> 
                        <span> More </span>            
                        <ion-icon name="chevron-forward-outline"></ion-icon> 
                    </button>
                </section>
            </ion-slide>
        </ion-slides>
    </div>

    <ion-fab vertical="bottom" horizontal="end" slot="fixed" *ngIf="showChat">
        <ion-fab-button class="chat-button" (click)="presentChatModal()">
            <ion-icon name="chatbubble-ellipses-outline"></ion-icon>
            <ion-badge color="dark"> 10 </ion-badge>
        </ion-fab-button>
    </ion-fab>

</ion-content>
