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

export default function DealerInfo(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-lg font-bold"}
    >
      <View className="col-span-1"></View>
      {config.showDealerName || config.showWatermelonGrade ? (
        <View className="col-span-3 flex items-end justify-center border-b border-black">
          {config.showDealerName ? config.dealerName : ""}
          {config.showDealerName && config.showWatermelonGrade ? "- " : ""}
          {config.showWatermelonGrade ? config.watermelonGrade : ""}
        </View>
      ) : (
        <View className="col-span-3"></View>
      )}
      {config.showDestination || config.showVehicleNumber ? (
        <View className="col-span-3 flex items-end justify-center border-b border-black">
          {config.showDestination ? config.destination : ""}
          {config.showVehicleNumber ? config.vehicleNumber : ""}
        </View>
      ) : (
        <View className="col-span-3"></View>
      )}
      <View className="col-span-1"></View>
    </View>
  );
}
