// js/components/widgets/pagamentos/PagamentosHeader.jsx
// [Wave 34 v224.15 NUCLEAR EXTRACT 2026-05-24] page-header + filtros + botão Novo
// Extract LITERAL Pagamentos.jsx L152-160
//
// Props:
//   - filter (obj) — {month, type, status}
//   - setFilter (fn) — atualiza filter state
//   - onNewClick (fn) — abre modal new pagamento
//
// Deps lazy: window.SmartSelect, window.Icon, window.PAGAMENTO_TYPES (global index.html L571)
(function(){
  'use strict';
  function PagamentosHeader(props){
    const SmartSelect = window.SmartSelect;
    const Icon = window.Icon;
    const PAGAMENTO_TYPES = window.PAGAMENTO_TYPES || [];
    const { filter, setFilter, onNewClick } = props;
    return (
      <div className="page-header">
        <div className="page-title">Pagamentos</div>
        <div style={{display:'flex',gap:10,alignItems:'center',flexWrap:'wrap'}}>
          <input type="month" value={filter.month} onChange={function(e){setFilter(function(f){return {...f, month:e.target.value};});}} style={{width:150}}/>
          <SmartSelect width={150} value={filter.type} onChange={function(val){setFilter(function(f){return {...f, type:val};});}} placeholder="Todos os tipos" options={[{value:'',label:'Todos os tipos'}].concat(PAGAMENTO_TYPES.map(function(t){return {value:t, label:t};}))}/>
          <SmartSelect width={140} value={filter.status} onChange={function(val){setFilter(function(f){return {...f, status:val};});}} placeholder="Todos status" options={[{value:'',label:'Todos status'}].concat(['Pendente','Pago','Cancelado'].map(function(x){return {value:x, label:x};}))}/>
          <button className="btn-gold" onClick={onNewClick} style={{display:'flex',alignItems:'center',gap:6}}><Icon n="plus" size={14}/>Novo Pagamento</button>
        </div>
      </div>
    );
  }
  window.ZNX = window.ZNX || {};
  window.ZNX.widgets = window.ZNX.widgets || {};
  window.ZNX.widgets.pagamentos = window.ZNX.widgets.pagamentos || {};
  window.ZNX.widgets.pagamentos.PagamentosHeader = PagamentosHeader;
  // [Wave 34 marker v224.15] confirma PagamentosHeader executado
  window.PagamentosHeader_v224_15_wave34 = true;
})();
