use crate::prelude::wrap::wrapper_div_with_attributes;
use yew::prelude::*;
use yew::virtual_dom::ApplyAttributeAs;
#[derive(Clone, PartialEq, Properties)]
pub struct GalleryProperties {
pub children: Children,
#[prop_or_default]
pub gutter: bool,
#[prop_or_default]
pub style: AttrValue,
}
#[function_component(Gallery)]
pub fn gallery(props: &GalleryProperties) -> Html {
let mut classes = classes!("pf-v5-l-gallery");
if props.gutter {
classes.push(classes!("pf-m-gutter"));
}
html! (
<div
class={classes}
style={&props.style}
>
{ for props.children.iter().map(|child|{
wrapper_div_with_attributes(child, &[("class", "pf-v5-l-gallery__item", ApplyAttributeAs::Attribute)])
}) }
</div>
)
}