<!DOCTYPE html>
<html lang="pt-BR">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Lista de Notícias - MS Solucoes / Assessi</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"
        integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
</head>

<body>
    <div class="container">
        <h1>Lista de Notícias</h1>
        <div class="row">
            @foreach ($noticias as $noticia)
                <div class="col-md-3 mb-4">
                    <div class="card">
                        <!-- Aqui, você deve verificar se o 'data' existe e está acessível -->
                        <div class="card-header">
                            {{ isset($noticia['data']) ? $noticia['data'] : 'Data não disponível' }}
                        </div>
                        <img src="{{ isset($noticia['imagem']) && $noticia['imagem'] ? asset($noticia['imagem']) : 'https://via.placeholder.com/150' }}"
                            class="card-img-top" alt="{{ $noticia['titulo'] }}">
                        <div class="card-body">
                            <h5 class="card-title">
                                <a href="{{ $noticia['link'] }}" target="_blank">{{ $noticia['titulo'] }}</a>
                            </h5>

                        </div>
                    </div>
                </div>
            @endforeach
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
        integrity="sha384-DbjY4+zGTfAP6Y46jw8+p5Bkl2jOmtwKe0gCZTVF1C+VJ44YqD+2kSo8zNGTkPZA" crossorigin="anonymous">
    </script>
</body>

</html>
