starting fresh
This commit is contained in:
parent
85fa9aff4a
commit
3a762d2343
111 changed files with 1939 additions and 2961 deletions
22
src/components/list/list.tsx
Normal file
22
src/components/list/list.tsx
Normal file
|
@ -0,0 +1,22 @@
|
|||
import { Accessor, Index, JSX } from "solid-js";
|
||||
import { css } from "./list.module.css";
|
||||
|
||||
interface ListProps<T> {
|
||||
label: string;
|
||||
items: T[];
|
||||
children: (item: Accessor<T>) => JSX.Element;
|
||||
}
|
||||
|
||||
export function List<T>(props: ListProps<T>) {
|
||||
return (
|
||||
<section class={css.container}>
|
||||
<b role="heading" class={css.heading}>
|
||||
{props.label}
|
||||
</b>
|
||||
|
||||
<ul class={css.list}>
|
||||
<Index each={props.items}>{(item) => props.children(item)}</Index>
|
||||
</ul>
|
||||
</section>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue