1use std::marker::PhantomData;
2
3use crate::prelude::*;
4use crate::{Buffer, Toolbar};
5
6#[derive(Element)]
7struct Editor<V: 'static> {
8 view_type: PhantomData<V>,
9 toolbar: Toolbar,
10 buffer: Buffer<V>,
11}
12
13impl<V: 'static> Editor<V> {
14 pub fn new(toolbar: Toolbar, buffer: Buffer<V>) -> Self {
15 Self {
16 view_type: PhantomData,
17 toolbar,
18 buffer,
19 }
20 }
21
22 fn render(&mut self, _: &mut V, cx: &mut ViewContext<V>) -> impl IntoElement<V> {
23 div().child(self.toolbar.clone())
24 }
25}