use leptos::prelude::*;
use super::error_state_boundary::{
ErrorState, ErrorStateIcon, ErrorStateTitle,
ErrorStateDescription, ErrorStateActions,
};
use canonrs_core::primitives::layout::stack::{StackPrimitive as Stack, StackDirection, StackGap};
use canonrs_core::primitives::layout::grid::{GridPrimitive as Grid, GridCols};
#[component]
pub fn ErrorStateShowcasePreview() -> impl IntoView {
view! {
<Stack direction=StackDirection::Vertical gap=StackGap::Lg>
<ErrorState>
<ErrorStateIcon>"⚠️"</ErrorStateIcon>
<ErrorStateTitle>"Something went wrong"</ErrorStateTitle>
<ErrorStateDescription>"We encountered an unexpected error. Please try again."</ErrorStateDescription>
<ErrorStateActions>"Retry"</ErrorStateActions>
</ErrorState>
<p data-rs-showcase-preview-anchor="">
"Error feedback always announced and structurally consistent."
</p>
<Stack direction=StackDirection::Vertical gap=StackGap::Sm>
<span data-rs-showcase-preview-label="">"Examples"</span>
<Grid cols=GridCols::Three>
<ErrorState>
<ErrorStateIcon>"🔌"</ErrorStateIcon>
<ErrorStateTitle>"Connection failed"</ErrorStateTitle>
<ErrorStateDescription>"Check your network and try again."</ErrorStateDescription>
<ErrorStateActions>"Reconnect"</ErrorStateActions>
</ErrorState>
<ErrorState>
<ErrorStateIcon>"🔒"</ErrorStateIcon>
<ErrorStateTitle>"Access denied"</ErrorStateTitle>
<ErrorStateDescription>"You do not have permission to view this page."</ErrorStateDescription>
<ErrorStateActions>"Go back"</ErrorStateActions>
</ErrorState>
<ErrorState>
<ErrorStateIcon>"🗄️"</ErrorStateIcon>
<ErrorStateTitle>"Failed to load data"</ErrorStateTitle>
<ErrorStateDescription>"The requested data could not be fetched."</ErrorStateDescription>
<ErrorStateActions>"Try again"</ErrorStateActions>
</ErrorState>
</Grid>
</Stack>
</Stack>
}
}