(props: AvatarFallbackProps)
| 196 | /// ``` |
| 197 | #[component] |
| 198 | pub fn AvatarFallback(props: AvatarFallbackProps) -> Element { |
| 199 | let mut ctx: AvatarCtx = use_context(); |
| 200 | |
| 201 | // Mark that a fallback child is provided |
| 202 | use_effect(move || { |
| 203 | ctx.has_fallback_child.set(true); |
| 204 | }); |
| 205 | |
| 206 | let show_fallback = |
| 207 | use_memo(move || matches!((ctx.state)(), AvatarState::Error | AvatarState::Empty)); |
| 208 | |
| 209 | if !show_fallback() { |
| 210 | return rsx!({}); |
| 211 | } |
| 212 | |
| 213 | rsx! { |
| 214 | span { ..props.attributes, {props.children} } |
| 215 | } |
| 216 | } |
| 217 | |
| 218 | /// The props for the [`AvatarImage`] component. |
| 219 | #[derive(Props, Clone, PartialEq)] |
nothing calls this directly
no outgoing calls
no test coverage detected