<style type="text/css">
    .file_no{
        border-bottom: none !important;
        color: #4c4c4c !important;
        transition: all 1s cubic-bezier(0.19, 1, 0.22, 1) 0s;
    }
    .file_no:hover{
        border-bottom: none !important;
        color: #ff7f00 !important;
        transition: all 1s cubic-bezier(0.19, 1, 0.22, 1) 0s;
    }
    .site-header .dropdown-menu-notif .dropdown-menu-notif-item{
        /*background: #dbe4ea !important;*/
        /*background: aliceblue !important;*/
    }
    /*.site-header .dropdown-menu-notif .dropdown-menu-notif-item .dot{
        display: none;
    }

    .site-header .dropdown-menu-notif .dropdown-menu-notif-item{
        padding: 8px 15px 8px 50px !important;
        border-bottom: .5px dashed #e3e8ec;
    }
    .site-header .dropdown-menu-notif .dropdown-menu-notif-item .photo{
        width: 35px !important;
        height: 35px !important;
    }*/

    .dot{
        display: inline-block;
        vertical-align: middle;
        width: 6px;
        height: 6px;
        margin: 0 0 6px;
        -webkit-border-radius: 50%;
        border-radius: 50%;
        background: #fa424a;
        position: relative;
        top: 2px;
    }
</style>


<div class="tbl form-section" style="margin-bottom: 15px;">
    <div class="tbl-row" style="@if($notification->read_at == null) background: aliceblue; @else background: #fff; @endif">
        <div class="tbl-cell tbl-cell-id left text-center" style="width: 10%;">
            <i class="fa fa-ticket" style="background: #dbe4ea; padding: 7px; border-radius: 50%; color: #ff7f00; font-size: 13px;"></i>
            
        </div>
        <div class="tbl-cell">
            <div class="box-typical py-3 px-2" style="margin: 10px 0px; border:0px; @if($notification->read_at == null) background: aliceblue; @else background: #fff; @endif">
                <div class="tbl details">
                    <div class="tbl-row">
                        <div class="tbl-cell">
                            <div class="exp-timeline-status">
                                {{-- @if($notification->read_at == null)
                                <div class="dot"></div>
                                @endif --}} 

                                    <a href="{{url('/admin/manage-tickets/ticket-details',$notification['data']['ticket']['id'])}}" onclick="markAdminAsRead('{{$notification->id}}');" class="file_no"> 

                                    @if($notification['data']['action_type'] =='Assigned')  
                                        {{-- @php
                                            $assigned = model('Agent')::where('id', $notification['data']['ticket']['creator_agent_id'])->first();
                                        @endphp
                                        <b> {{ $assigned['name'] }} assigned you a token #{{$notification['data']['ticket']['ticket_number']}}</b> --}}
                                        <b>{{ $notification['data']['addedBy']['name'] }} assigned you a token #{{$notification['data']['ticket']['ticket_number']}}</b>
                                    @endif

                                    @if($notification['data']['action_type'] =='Open')
                                        @php 
                                           $company_name = model('Company')::where('id',$notification['data']['ticket']['company_id'])->first();
                                        @endphp
                                        @if($company_name)
                                             <b>{{ $notification['data']['addedBy']['name'] }}</b> from
                                             <b>  <span>{{ $company_name['name'] }}</b> has created this token #<b>{{ $notification['data']['ticket']['ticket_number'] }}</b>
                                            @else
                                             <b>{{ $notification['data']['addedBy']['name'] }}</b> has created this token #<b>{{ $notification['data']['ticket']['ticket_number'] }}</b>
                                        @endif
                                    @endif
                                   
                                    @if($notification['data']['action_type'] =='Start') 

                                        <b>{{ $notification['data']['addedBy']['name'] }} started token #{{$notification['data']['ticket']['ticket_number']}}</b>
                                    @endif

                                    @if($notification['data']['action_type'] =='Finish')  

                                        <b>{{ $notification['data']['addedBy']['name'] }} fixed token #{{$notification['data']['ticket']['ticket_number']}}</b>
                                    @endif

                                    @if($notification['data']['action_type'] =='Close') 
                                        <b>{{ $notification['data']['addedBy']['name'] }} close token #{{$notification['data']['ticket']['ticket_number']}}</b>
                                    @endif

                                    @if($notification['data']['action_type']=="Reopen") 
                                          
                                        <b>{{ $notification['data']['addedBy']['name'] }} reopen token #{{$notification['data']['ticket']['ticket_number']}}</b>
                                    @endif 

                                    @if($notification['data']['action_type']=="Comment") 
                                        <b>A Comment this token #{{$notification['data']['ticket']['ticket_number']}}</b>
                                    @endif   
                                </a><br>   
                               {{--  <small><b>{{$notification['data']['ticket']['title']}}</b>  Deadline {{date('d M Y',strtotime($notification['data']['task']['created_at']))}}.</small> --}}
                            </div>
                        </div>
                    </div>
                    <div class="tbl-row">
                        <div class="tbl-cell">
                            <div class="color-blue-grey-lighter"> 
                                {{$notification->created_at->diffForHumans()}}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">
    function markAsRead(id) {
         $.post('{{url('')}}/admin/notification/mark-as-read', {'_token': '{{ csrf_token() }}','id': id}, function (data) {
            data.success ? (window.location.href = targetHref) : false;
        }, 'json');

        return false;
    }
</script>