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

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

  return (
    <View
      key={module.id}
      className={"preview grid w-full grid-cols-8 gap-0 text-base"}
    >
      {config.showShippingFrom && (
        <>
          <View className="col-span-1 flex items-end justify-center">
            发货地:
          </View>
          <View className="col-span-3 flex items-end justify-center border-b border-black">
            {config.shippingFrom}
          </View>
        </>
      )}
      {config.showDate && (
        <>
          <View className="col-span-1 flex items-end justify-center">
            日期:
          </View>
          <View className="col-span-3 flex items-end justify-center border-b border-black">
            {config.date}
          </View>
        </>
      )}
    </View>
  );
}
