SU-SWS/stanford_profile_helper

View on GitHub
src/Plugin/Block/PDBlock.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%
<?php

namespace Drupal\stanford_profile_helper\Plugin\Block;

use Drupal\Core\Block\Attribute\Block;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\pdb\Plugin\Block\PdbBlock;
use Drupal\stanford_profile_helper\Plugin\Derivative\ReactBlockDeriver;

/**
 * Exposes a React component as a block.
 */
#[Block(
  id: "pdb_component",
  admin_label: new TranslatableMarkup("PDB Component"),
  deriver: ReactBlockDeriver::class
)]
class PDBlock extends PdbBlock {

  /**
   * {@inheritDoc}
   *
   * @codeCoverageIgnore
   */
  public function attachLibraries(array $component) {
    return ['library' => parent::attachLibraries($component)];
  }

}