leptos_struct_table/class_providers/
bootstrap.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::TableClassesProvider;

#[derive(Clone, Copy)]
pub struct BootstrapClassesPreset;

impl TableClassesProvider for BootstrapClassesPreset {
    fn new() -> Self {
        Self
    }

    fn row(&self, _: usize, selected: bool, template_classes: &str) -> String {
        let active = if selected { "table-active" } else { "" };

        format!("{} {}", active, template_classes)
    }

    // TODO : skeleton loading
}