mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-02 20:15:22 +02:00
* Initial data objects * Remove trend calculator * Fill in balance reconciliation for entry group * Initial tooltip component * Balance trends in activity view * Lint fixes * trade partial alignment fix * Tweaks to balance calculation to acknowledge holdings value better * More lint fixes * Bump brakeman dep * Test fixes * Remove unused class
35 lines
606 B
Ruby
35 lines
606 B
Ruby
class UI::Account::ActivityFeed < ApplicationComponent
|
|
attr_reader :feed_data, :pagy, :search
|
|
|
|
def initialize(feed_data:, pagy:, search: nil)
|
|
@feed_data = feed_data
|
|
@pagy = pagy
|
|
@search = search
|
|
end
|
|
|
|
def id
|
|
dom_id(account, :activity_feed)
|
|
end
|
|
|
|
def broadcast_channel
|
|
account
|
|
end
|
|
|
|
def broadcast_refresh!
|
|
Turbo::StreamsChannel.broadcast_replace_to(
|
|
broadcast_channel,
|
|
target: id,
|
|
renderable: self,
|
|
layout: false
|
|
)
|
|
end
|
|
|
|
def activity_dates
|
|
feed_data.entries_by_date
|
|
end
|
|
|
|
private
|
|
def account
|
|
feed_data.account
|
|
end
|
|
end
|