/* eslint-disable @typescript-eslint/no-explicit-any */
interface AddressLabelProps {
    order?: any; // Ideally replace `any` with the correct type
  }
  
  const PrintAddress: React.FC<AddressLabelProps> = ({ order }) => {
    const formattedAddress = `${order?.destination_block_details?.name || ""}, ${
      order?.destination_road_details?.name || ""
    } & ${order?.destination_building_details?.name || ""}, ${
      order?.destinationFlatOrOfficeNumber || ""
    }`;
  
    return (
      <div className="address-label">
        <p className="s4">
          {formattedAddress.trim() !== ",  & ," ? (
            <>
              {order?.destination_block_details?.name},<br />
              {order?.destination_road_details?.name},<br />
              {order?.destination_building_details?.name},<br />
              {order?.destinationFlatOrOfficeNumber}
            </>
          ) : (
            <>
              57 Parkway, 5th Floor
              <br />
              New York
              <br />
              NY 10013
              <br />
              USA
            </>
          )}
        </p>
      </div>
    );
  };
  
  export default PrintAddress;
  