pub mod audio_player;
pub mod gltf;
pub mod model_viewer;
pub mod transport;
pub mod video_player;
pub use audio_player::AudioPlayer;
pub use gltf::{ModelBounds, ModelDefect, ModelError, ModelLimit, ModelMesh, ModelScene};
pub use model_viewer::{ModelShading, ModelState, ModelViewer, ModelViewerEvent};
pub use transport::{
FixtureTransport, MediaAvailability, MediaCommand, MediaEvent, MediaOrigin, MediaOutcome,
MediaSnapshot, MediaTransport,
};
pub use video_player::VideoPlayer;
use gpui::{AnyElement, Hsla, IntoElement, ParentElement, SharedString, Styled, div, px};
use gpui_kit_theme::{Space, Theme, TypeScale};
use crate::foundation::{StyledExt, text};
#[derive(Clone, Copy, PartialEq, Eq)]
pub(crate) enum NoticePlace {
Middle,
Foot,
}
fn notice(theme: &Theme, tint: Hsla, title: SharedString, detail: SharedString) -> AnyElement {
notice_at(theme, tint, title, detail, NoticePlace::Middle)
}
fn notice_at(
theme: &Theme,
tint: Hsla,
title: SharedString,
detail: SharedString,
place: NoticePlace,
) -> AnyElement {
let base = match place {
NoticePlace::Middle => div().absolute().inset_0().justify_center(),
NoticePlace::Foot => div()
.absolute()
.bottom_0()
.left_0()
.right_0()
.bg(theme.colors.canvas.opacity(0.88)),
};
base.column()
.items_center()
.gap_token(theme, Space::Xs)
.p_token(theme, Space::Lg)
.text_align(gpui::TextAlign::Center)
.child(text(theme, TypeScale::Subtitle, title))
.child(
text(theme, TypeScale::Body, detail)
.max_w(px(360.0))
.text_color(tint),
)
.into_any_element()
}