Skip to content

Commit

Permalink
fix: empty-override-prompt-text
Browse files Browse the repository at this point in the history
  • Loading branch information
Pratik Mishra authored and Pratik Mishra committed Aug 29, 2024
1 parent d142ce5 commit 5dfe38f
Showing 1 changed file with 29 additions and 14 deletions.
43 changes: 29 additions & 14 deletions crates/frontend/src/pages/context_override.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,20 +335,35 @@ pub fn context_override() -> impl IntoView {
(context.clone(), overrides)
})
.collect::<Vec<(Context, Map<String, Value>)>>();
ctx_n_overrides
.into_iter()
.map(|(context, overrides)| {
view! {
<ContextCard
context=context
overrides=overrides
handle_edit=handle_context_edit
handle_clone=handle_context_clone
handle_delete=handle_context_delete
/>
}
})
.collect_view()
if ctx_n_overrides.is_empty() {
view! {
<div class="flex-row">
<div class="flex justify-center">
<i class="ri-file-add-line ri-xl"></i>
</div>
<div class="flex mt-4 font-semibold items-center text-gray-400 text-xl justify-center">
"Start with creating an override"
</div>
</div>

}.into_view()
} else {
ctx_n_overrides
.into_iter()
.map(|(context, overrides)| {
view! {
<ContextCard
context=context
overrides=overrides
handle_edit=handle_context_edit
handle_clone=handle_context_clone
handle_delete=handle_context_delete
/>
}
})
.collect_view()
}

}}

</div>
Expand Down

0 comments on commit 5dfe38f

Please sign in to comment.