"use client";

import AdminModal from '@/app/components/admin/admin-modal.jsx';

export default function TrustModeConfirmModal({ open, busy, onConfirm, onCancel }) {
  return (
    <AdminModal
      open={open}
      onClose={() => !busy && onCancel?.()}
      eyebrow="Trust mode"
      title="Enable trust mode?"
    >
      <div className="agents-modal-form">
        <p className="agents-modal-help">
          The main agent will execute file writes, terminal commands, and process actions without per-call approval.
        </p>

        <section className="agents-modal-section">
          <div className="agents-modal-section-head">
            <span>Still blocked</span>
            <small>These commands are always denied, even in trust mode.</small>
          </div>
          <div className="agents-modal-chip-row">
            <code>sudo</code>
            <code>rm -rf</code>
            <code>git reset --hard</code>
          </div>
        </section>

        <p className="agents-modal-help">You can flip back at any time.</p>

        <footer className="agents-modal-foot">
          <button
            type="button"
            className="admin-button secondary"
            onClick={onCancel}
            disabled={busy}
          >
            Cancel
          </button>
          <button
            type="button"
            className="admin-button"
            onClick={onConfirm}
            disabled={busy}
            autoFocus
          >
            {busy ? 'Enabling…' : 'Enable trust mode'}
          </button>
        </footer>
      </div>
    </AdminModal>
  );
}
