<?php
/**
 * Camera detail partial — Action buttons (Quick Check, End Monitoring + modal).
 *
 * @package My Trail Camera
 * @since   8.2.0
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Render action buttons for a camera detail row.
 *
 * @param string $cam_id        Camera ID.
 * @param array  $cam           Camera data.
 * @param int    $days_in_field Days since deployment.
 * @param array  $zones         All monitoring zones (PRO).
 * @param array  $all_cameras   All cameras array.
 */
function mtcam_render_detail_actions( $cam_id, $cam, $days_in_field, $extras, $all_cameras ) {
?>
<!-- Quick Check button (active, non-stolen cameras) -->
<?php if (mtcam_is_my_camera($cam) && mtcam_is_active($cam) && empty($cam['stolen_date'])): ?>
<div class="mtcam-full-width-row">
    <form method="post" style="display:inline;">
        <?php wp_nonce_field('mtcam_settings'); ?>
        <input type="hidden" name="mtcam_camera_check" value="<?php echo esc_attr($cam_id); ?>">
        <input type="hidden" name="redirect_to" value="dashboard">
        <button type="submit" class="button button-secondary" title="<?php esc_attr_e('Record a camera check — battery swap, SD card change, physical inspection, etc.', 'my-trail-camera'); ?>">🔍 <?php esc_html_e('Check', 'my-trail-camera'); ?></button>
    </form>
</div>
<?php endif; ?>

<?php
}
