use gpui::{div, prelude::*};
use crate::sx::{Sx, SxStyled};
use crate::{component, styles};
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub enum SeparatorOrientation {
#[default]
Horizontal,
Vertical,
}
styles! {
SEPARATOR = {
base: { flex: none, background: border },
orientation(SeparatorOrientation): {
Horizontal: { height: 0.25, width: full },
Vertical: { width: 0.25, height: full },
},
}
}
#[component]
pub fn Separator(
#[prop(optional)] orientation: SeparatorOrientation,
#[sx] sx: Sx,
) -> impl IntoElement {
div().sx((&SEPARATOR.base, SEPARATOR.orientation(orientation), &sx))
}