use super::{BasePattern, component_json};
use serde_json::Value;
pub struct MarketingPattern {
base: BasePattern,
}
impl MarketingPattern {
pub fn new() -> Self {
Self {
base: BasePattern::new(),
}
}
pub fn with_product_hero(mut self, data: Value) -> Self {
self.base.hero = Some(component_json("product-hero", data));
self
}
pub fn add_problem_section(mut self, items: Vec<Value>) -> Self {
self.base.context.extend(items);
self
}
pub fn add_features(mut self, data: Value) -> Self {
self.base.analysis.push(component_json("feature-grid", data));
self
}
pub fn add_benefits(mut self, data: Value) -> Self {
self.base.analysis.push(component_json("benefit-strip", data));
self
}
pub fn add_comparison(mut self, data: Value) -> Self {
self.base.analysis.push(component_json("comparison-block", data));
self
}
pub fn add_process_flow(mut self, data: Value) -> Self {
self.base.solution.push(component_json("process-flow", data));
self
}
pub fn add_testimonial(mut self, data: Value) -> Self {
self.base.actions.push(component_json("testimonial", data));
self
}
pub fn add_use_case(mut self, data: Value) -> Self {
self.base.actions.push(component_json("use-case-card", data));
self
}
pub fn add_pull_quote(mut self, data: Value) -> Self {
self.base.actions.push(component_json("pull-quote", data));
self
}
pub fn with_cta(mut self, data: Value) -> Self {
self.base.cta = Some(component_json("cta-box", data));
self
}
pub fn add_pricing_cards(mut self, cards: Vec<Value>) -> Self {
for card in cards {
self.base.actions.push(component_json("pricing-card", card));
}
self
}
pub fn to_components(self) -> Vec<Value> {
self.base.to_components()
}
}
impl Default for MarketingPattern {
fn default() -> Self {
Self::new()
}
}