# frozen_string_literal: true
module Widgets
class Peers
attr_reader :focused
def initialize(x, y, width, height)
@focused = false
@search = Widgets::Search.new x, y, width, 1
@list = List.new x, y + 1, width, height - 1
end
def render
@search.render
@list.render
def trigger(event)
case event
when Events::Panel::Base
@list.trigger event
when Events::Text::Base
@search.trigger event
def focused=(value)
@focused = !!value
@list.focused = focused
@search.focused = focused