move shift_button to its own component

main
Zynh0722 2023-09-26 17:11:36 -07:00
parent 46613af5f3
commit 20b0ec7ff4
2 changed files with 13 additions and 7 deletions

View File

@ -0,0 +1,11 @@
@use super::close_shift_button_html;
@use super::open_shift_button_html;
@use cm_lib::models::Shift;
@(open_shift: Option<Shift>)
@if open_shift.is_none() {
@:open_shift_button_html()
} else {
@:close_shift_button_html(open_shift.unwrap())
}

View File

@ -1,6 +1,5 @@
@use super::base_html;
@use super::components::close_shift_button_html;
@use super::components::open_shift_button_html;
@use super::components::shift_button_html;
@use cm_lib::models::Shift;
@(open_shift: Option<Shift>)
@ -9,11 +8,7 @@
<main>
<div>
@if open_shift.is_none() {
@:open_shift_button_html()
} else {
@:close_shift_button_html(open_shift.unwrap())
}
@:shift_button_html(open_shift)
</div>
</main>