import { View } from "@tarojs/components";
import { Fragment } from "react";

export default function (props: { module: any }) {
  const { module } = props;
  const { config } = module;

  console.log(config);

  return (
    <View
      key={module.id}
      className={"preview grid w-full grid-cols-8 gap-0 text-base"}
    >
      {config.feeItems?.map((feeType: any) => (
        <Fragment key={feeType.costId}>
          <View className="col-span-1 flex items-end justify-center">
            {config.feeLabels[feeType.costId]}：
          </View>
          <View className="col-span-1 flex items-end justify-center border-b border-black">
            {feeType.count * feeType.price}元
          </View>
        </Fragment>
      ))}
    </View>
  );
}
