<?php
declare(strict_types=1);

namespace App\Framework\Http\Responses;

use App\Framework\Http\Headers;
use App\Framework\Http\Response;
use App\Framework\Http\Status;

final readonly class JsonResponse implements Response
{
    public Headers $headers;

    public string $body;
    public function __construct(
        array $body = [],
        public Status $status = Status::OK,
    ) {
        $this->headers = new Headers()->with('Content-Type', 'application/json');
        $this->body = json_encode($body);
    }
}
