@extends ('layouts/template')

@section('content')

<div class="p-3 mcp-theme-1">
    <div class="card">

        <div class="card-header px-3 py-2 d-flex align-items-center">
            <strong class="mr-4">
                <i class="fas fa-user"></i>
                My Teams
            </strong>
        </div>
        <div class="card-body p-0">

            <table class="table table-sm table-condensed p-0 m-0">
                <thead class="bg-light">
                <tr>
                    <th class="px-3 border-0">Team Name</th>
                    <th class="border-0">URL</th>
                    <th class="border-0">MCP</th>
                    <th class="border-0">RD</th>
                    <th class="border-0">Created</th>
                </tr>
                </thead>
                <tbody>
                @foreach ($teams as $team)
                    <tr>
                        <td class="px-3">
                            {{ $team->internal_name }}
                        </td>
                        <td class="">
                            <a native target="_blank" href="{{config('app.stagfe6_url') . '/' . $team->slug}}">{{ $team->slug }}</a>
                        </td>
                        <td class="">
                            {{ $team->mcp ? $team->mcp->displayName() : '-' }}
                        </td>
                        <td class="">
                            {{ $team->rd ? $team->rd->displayName() : '-' }}
                        </td>
                        <td class="px-3">
                            {{ friendlier_date_time($team->created_at) }}
                        </td>
                    </tr>
                @endforeach
                @if(count($teams) == 0)
                    <tr>
                    <td colspan="5" class="text-center">No records found.</td>
                    </tr>
                @endif
                </tbody>
            </table>
        </div>
    </div>
</div>

@endsection
