<?php
/**
 * Template part for displaying the AUX deprecations audit page in the WordPress admin.
 *
 * Loaded by /inc/WP_AUX/Entities/Admin/AuxDeprecationsPageEntity.php.
 *
 * @package MarComm-AUX
 * @since 1.0.0
 */
declare(strict_types=1);

$rows = $args['rows'];

add_thickbox();
?>
<h1>Deprecations</h1>
  <table class="table" id="aux-components">
    <thead>
    <tr>
      <th>Post</th>
      <th>Component</th>
      <th>Old Field</th>
      <th>New Field</th>
    </tr>
    </thead>
    <tbody>
    <?php
    foreach ($rows as $rowKey => $row) {
      ?>
      <tr>
        <th>
          <span><?php echo $row['post_title']; ?> (<?php echo $row['post_type']; ?>)</span>
          <a href="<?php echo $row['post_view_url']; ?>">View</a> |
          <a href="<?php echo $row['post_edit_url']; ?>">Edit</a>
        </th>
        <td>
          <?php echo $row['component']; ?>
        </td>
        <td>
          <?php echo $row['deprecated_field']; ?>
        </td>
        <td>
          <?php echo $row['replaced_with_field']; ?>
        </td>
      </tr>
      <?php
    }
    ?>
    </tbody>
  </table>
