<?php

namespace Drupal\nodehive_core_space_dashboard\Controller;

use Drupal\Core\Controller\ControllerBase;
use Drupal\nodehive_core\SpaceInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;

/**
 * Redirects the space canonical route to the content tab.
 */
class SpaceRedirectController extends ControllerBase {

  /**
   * Redirects /space/{id} to /space/{id}/content.
   */
  public function toContent(SpaceInterface $nodehive_space): RedirectResponse {
    return new RedirectResponse('/space/' . $nodehive_space->id() . '/content', 302);
  }

}
