<?php

$project = [
    'title'    => $page->title()->value(),
    'url'      => $page->url(),
    'modified' => $page->modified('Y-MM-d'),
    'status'   => $page->status(),
    'logo'     => $page->client()->isNotEmpty() && $page->client()->toPage()
        ? $page->client()->toPage()->logo()->toFile()->url()
        : null,
    'steps'                  => $page->getSteps(),
    'designToLight'          => $page->isDTLEnabled()->isTrue() ? processDTLProposals($page) : null,
    'hasOptimizationRequest' => $page->hasOptimizationRequest()->isTrue(),
    'notifications'          => $page->notifications()->yaml(),
];

$pageData = array_merge($genericData, $project);

echo json_encode([
    'page' => $pageData,
    'user' => $userData,
]);
