mirror of
https://github.com/twitter/the-algorithm.git
synced 2024-06-27 13:36:03 +02:00
39 lines
1.5 KiB
Scala
39 lines
1.5 KiB
Scala
|
package com.twitter.home_mixer.functional_component.decorator
|
||
|
|
||
|
import com.twitter.home_mixer.product.following.model.HomeMixerExternalStrings
|
||
|
import com.twitter.product_mixer.component_library.model.candidate.TweetCandidate
|
||
|
import com.twitter.product_mixer.core.model.marshalling.response.urt.icon
|
||
|
import com.twitter.product_mixer.core.model.marshalling.response.urt.metadata.ChildFeedbackAction
|
||
|
import com.twitter.product_mixer.core.model.marshalling.response.urt.metadata.RichBehavior
|
||
|
import com.twitter.product_mixer.core.model.marshalling.response.urt.metadata.RichFeedbackBehaviorReportTweet
|
||
|
import com.twitter.product_mixer.core.product.guice.scope.ProductScoped
|
||
|
import com.twitter.stringcenter.client.StringCenter
|
||
|
|
||
|
import javax.inject.Inject
|
||
|
import javax.inject.Singleton
|
||
|
|
||
|
@Singleton
|
||
|
case class ReportTweetChildFeedbackActionBuilder @Inject() (
|
||
|
@ProductScoped stringCenter: StringCenter,
|
||
|
externalStrings: HomeMixerExternalStrings) {
|
||
|
|
||
|
def apply(
|
||
|
candidate: TweetCandidate
|
||
|
): Option[ChildFeedbackAction] = {
|
||
|
Some(
|
||
|
ChildFeedbackAction(
|
||
|
feedbackType = RichBehavior,
|
||
|
prompt = Some(stringCenter.prepare(externalStrings.reportTweetString)),
|
||
|
confirmation = None,
|
||
|
feedbackUrl = None,
|
||
|
hasUndoAction = Some(true),
|
||
|
confirmationDisplayType = None,
|
||
|
clientEventInfo = None,
|
||
|
icon = Some(icon.Flag),
|
||
|
richBehavior = Some(RichFeedbackBehaviorReportTweet(candidate.id)),
|
||
|
subprompt = None
|
||
|
)
|
||
|
)
|
||
|
}
|
||
|
}
|