<!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 Posts</title>
</head>
<body>
    <h1>Lista de Posts</h1>

    @if(isset($error))
        <p><strong>{{ $error }}</strong></p>
    @else
        <ul>
            @foreach($posts as $post)
                <li>
                    <h2><a href="{{ $post['link'] }}" target="_blank">{{ $post['title']['rendered'] }}</a></h2>
                    <p><strong>Data de Publicação:</strong> {{ \Carbon\Carbon::parse($post['date'])->format('d/m/Y H:i') }}</p>
                    <p>{{ strip_tags($post['excerpt']['rendered']) }}</p>
                </li>
            @endforeach
        </ul>
    @endif
</body>
</html>