Docs
This commit is contained in:
@@ -3,11 +3,14 @@ import { joinClass, val } from "../core/utils.js";
|
||||
|
||||
/** LIST */
|
||||
export const List = (props) => {
|
||||
const { items, header, render, keyFn, class: className, ...rest } = props;
|
||||
|
||||
const headerItem = header
|
||||
? $html("li", { class: "p-4 pb-2 text-xs opacity-60 tracking-wide" }, [val(header)])
|
||||
: null;
|
||||
const {
|
||||
items,
|
||||
header,
|
||||
render,
|
||||
keyFn = (item, index) => index,
|
||||
class: className,
|
||||
...rest
|
||||
} = props;
|
||||
|
||||
const listItems = $for(
|
||||
items,
|
||||
@@ -21,6 +24,6 @@ export const List = (props) => {
|
||||
...rest,
|
||||
class: joinClass("list bg-base-100 rounded-box shadow-md", className),
|
||||
},
|
||||
header ? [headerItem, listItems] : listItems
|
||||
header ? [$if(header, () => $html("li", { class: "p-4 pb-2 text-xs opacity-60" }, [val(header)])), listItems] : listItems
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user