import { h } from "@stencil/core";
import { formatDate, formatTime } from "../../utils/utils";
import { MapCheckoutStatusToBadge } from "./checkouts-status";
import { getAlternateTableCellPart, tableHeadCell } from "../../styles/parts";
export const defaultColumnsKeys = 'created_at,payment_amount,payment_description,payment_mode,status';
export const checkoutTableColumns = {
    created_at: () => (h("th", { part: tableHeadCell, scope: "col", title: "The date each checkout occurred" }, "Processed On")),
    payment_amount: () => (h("th", { part: tableHeadCell, scope: "col", title: "The dollar amount of each checkout" }, "Payment Amount")),
    payment_description: () => (h("th", { part: tableHeadCell, scope: "col", title: "The description of each checkout" }, "Payment Description")),
    sub_account_name: () => (h("th", { part: tableHeadCell, scope: "col", title: "The sub account associated with the checkout" }, "Sub Account")),
    payment_mode: () => (h("th", { part: tableHeadCell, scope: "col", title: "The payment mode of each checkout" }, "Payment Mode")),
    status: () => (h("th", { part: tableHeadCell, scope: "col", title: "The current status of each checkout" }, "Status")),
};
export const checkoutTableCells = {
    created_at: (checkout, index) => (h("td", { part: getAlternateTableCellPart(index) }, h("div", { class: "fw-bold" }, formatDate(checkout.created_at)), h("div", { class: "fw-bold" }, formatTime(checkout.created_at)))),
    payment_amount: (checkout, index) => (h("td", { part: getAlternateTableCellPart(index) }, checkout.formattedPaymentAmount(checkout.payment_amount))),
    payment_description: (checkout, index) => (h("td", { part: getAlternateTableCellPart(index) }, checkout.payment_description)),
    sub_account_name: (checkout, index) => (h("td", { part: getAlternateTableCellPart(index) }, checkout.sub_account_name)),
    payment_mode: (checkout, index) => (h("td", { part: getAlternateTableCellPart(index) }, checkout.payment_mode)),
    status: (checkout, index) => (h("td", { part: getAlternateTableCellPart(index) }, MapCheckoutStatusToBadge(checkout.status))),
};
