import { Dynamic } from "solid-js/web";
import { mergeProps, Show } from "solid-js";

import config from "../base/config"

import TableItem from "./tableItem";

import "./table.css"

function table(props) {
    const parentProps = mergeProps(props);
    return <div className={"table " + (props.localclass || "") }>
        <Show when={parentProps.head && parentProps.head.length}>
            <div className="head">
                <TableItem list={parentProps.head || []} />
            </div>
        </Show>
        <Show when={parentProps.body && parentProps.body.length}>
            <div className="bodyB">
                <div className="body">
                    <For each={parentProps.body}>
                        {(b) => (
                            <TableItem showColor={b.color || "rgb(215 1 1 / 60%)"} list={b.col || []} />
                        )}
                    </For>
                </div>
            </div>
        </Show>
    </div>
}

export default table;
