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.showWatermelonGrade
            ? `${config.dealerName}-${config.watermelonGrade}`
            : config.dealerName}
        </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.destination}
          {config.vehicleNumber}
        </View>
      ) : (
        <View className="col-span-3"></View>
      )}
      <View className="col-span-1"></View>
    </View>
  );
}
