use cvkg_core::{View, Never};

/// Navigation stack for push/pop navigation
#[allow(dead_code)]
pub struct NavigationStack<V> {
    pub(crate) root: V,
}

impl<V: View> NavigationStack<V> {
    /// Create a new NavigationStack.
    ///
    /// # Examples
    /// ```
    /// use cvkg_components::{NavigationStack, Text};
    /// let nav = NavigationStack::new(Text::new("Root"));
    /// ```
    pub fn new(root: V) -> Self {
        Self { root }
    }
}

impl<V: View> View for NavigationStack<V> {
    type Body = Never;
    fn body(self) -> Self::Body { unreachable!() }
}

/// Navigation split view for sidebar layouts
#[allow(dead_code)]
pub struct NavigationSplitView<S, D> {
    pub(crate) sidebar: S,
    pub(crate) detail: D,
}

impl<S: View, D: View> NavigationSplitView<S, D> {
    /// Create a new NavigationSplitView.
    ///
    /// # Examples
    /// ```
    /// use cvkg_components::{NavigationSplitView, Text};
    /// let split = NavigationSplitView::new(Text::new("Sidebar"), Text::new("Detail"));
    /// ```
    pub fn new(sidebar: S, detail: D) -> Self {
        Self { sidebar, detail }
    }
}

impl<S: View, D: View> View for NavigationSplitView<S, D> {
    type Body = Never;
    fn body(self) -> Self::Body { unreachable!() }
}

/// Tab bar navigation view
#[allow(dead_code)]
pub struct TabView<V> {
    pub(crate) content: V,
}

impl<V: View> TabView<V> {
    /// Create a new TabView.
    ///
    /// # Examples
    /// ```
    /// use cvkg_components::{TabView, Text};
    /// let tabs = TabView::new(Text::new("Tabs"));
    /// ```
    pub fn new(content: V) -> Self {
        Self { content }
    }
}

impl<V: View> View for TabView<V> {
    type Body = Never;
    fn body(self) -> Self::Body { unreachable!() }
}

/// Modal bottom sheet or centered dialog
#[allow(dead_code)]
pub struct Sheet<V> {
    pub(crate) content: V,
    pub(crate) is_presented: bool,
}

impl<V: View> Sheet<V> {
    /// Create a new Sheet.
    ///
    /// # Examples
    /// ```
    /// use cvkg_components::{Sheet, Text};
    /// let sheet = Sheet::new(Text::new("Content"), true);
    /// ```
    pub fn new(content: V, is_presented: bool) -> Self {
        Self { content, is_presented }
    }
}

impl<V: View> View for Sheet<V> {
    type Body = Never;
    fn body(self) -> Self::Body { unreachable!() }
}

/// System alert dialog
#[allow(dead_code)]
pub struct Alert {
    pub(crate) title: String,
    pub(crate) is_presented: bool,
}

impl Alert {
    /// Create a new Alert.
    ///
    /// # Examples
    /// ```
    /// use cvkg_components::Alert;
    /// let alert = Alert::new("Warning", true);
    /// ```
    pub fn new(title: impl Into<String>, is_presented: bool) -> Self {
        Self { title: title.into(), is_presented }
    }
}

impl View for Alert {
    type Body = Never;
    fn body(self) -> Self::Body { unreachable!() }
}

/// Action sheet confirmation dialog
#[allow(dead_code)]
pub struct ConfirmationDialog {
    pub(crate) title: String,
    pub(crate) is_presented: bool,
}

impl ConfirmationDialog {
    /// Create a new ConfirmationDialog.
    ///
    /// # Examples
    /// ```
    /// use cvkg_components::ConfirmationDialog;
    /// let dialog = ConfirmationDialog::new("Are you sure?", true);
    /// ```
    pub fn new(title: impl Into<String>, is_presented: bool) -> Self {
        Self { title: title.into(), is_presented }
    }
}

impl View for ConfirmationDialog {
    type Body = Never;
    fn body(self) -> Self::Body { unreachable!() }
}

/// Context menu dropdown
#[allow(dead_code)]
pub struct Menu<V> {
    pub(crate) content: V,
}

impl<V: View> Menu<V> {
    /// Create a new Menu.
    ///
    /// # Examples
    /// ```
    /// use cvkg_components::{Menu, Text};
    /// let menu = Menu::new(Text::new("Options"));
    /// ```
    pub fn new(content: V) -> Self {
        Self { content }
    }
}

impl<V: View> View for Menu<V> {
    type Body = Never;
    fn body(self) -> Self::Body { unreachable!() }
}

/// Scrollable list layout
#[allow(dead_code)]
pub struct List<V> {
    pub(crate) content: V,
}

impl<V: View> List<V> {
    /// Create a new List.
    ///
    /// # Examples
    /// ```
    /// use cvkg_components::{List, Text};
    /// let list = List::new(Text::new("Item 1"));
    /// ```
    pub fn new(content: V) -> Self {
        Self { content }
    }
}

impl<V: View> View for List<V> {
    type Body = Never;
    fn body(self) -> Self::Body { unreachable!() }
}

/// Multi-column table layout
#[allow(dead_code)]
pub struct Table<V> {
    pub(crate) content: V,
}

impl<V: View> Table<V> {
    /// Create a new Table.
    ///
    /// # Examples
    /// ```
    /// use cvkg_components::{Table, Text};
    /// let table = Table::new(Text::new("Row 1"));
    /// ```
    pub fn new(content: V) -> Self {
        Self { content }
    }
}

impl<V: View> View for Table<V> {
    type Body = Never;
    fn body(self) -> Self::Body { unreachable!() }
}

/// Settings style grouped form layout
#[allow(dead_code)]
pub struct Form<V> {
    pub(crate) content: V,
}

impl<V: View> Form<V> {
    /// Create a new Form.
    ///
    /// # Examples
    /// ```
    /// use cvkg_components::{Form, Text};
    /// let form = Form::new(Text::new("Field 1"));
    /// ```
    pub fn new(content: V) -> Self {
        Self { content }
    }
}

impl<V: View> View for Form<V> {
    type Body = Never;
    fn body(self) -> Self::Body { unreachable!() }
}
