tagName: "div",
attributes: {
class: "property-card",
"data-id": property.id || "unknown",
},
copyable: false,
droppable: false,
draggable: false,
removable: false,
components: [
{
tagName: "div",
attributes: { class: "property-card-image-container" },
copyable: false,
droppable: false,
draggable: false,
removable: false,
components: [
{
tagName: "div",
attributes: {
id: carousel-${property.id},
class: "carousel slide",
"data-bs-ride": "carousel",
},
copyable: false,
droppable: false,
draggable: false,
removable: false,
components: [
{
tagName: "div",
attributes: { class: "carousel-inner" },
copyable: false,
droppable: false,
draggable: false,
removable: false,
components: (property.images && property.images.length > 0
? property.images
: ["https://via.placeholder.com/600x400"]
).map((obj, index) => ({
tagName: "div",
attributes: {
class: carousel-item${index === 0 ? " active" : ""},
},
copyable: false,
droppable: false,
draggable: false,
removable: false,
components: [
{
tagName: "img",
attributes: {
src: obj.image,
class: "d-block w-100 property-card-image",
alt: property.title || "Property Image",
},
copyable: false,
droppable: false,
draggable: false,
removable: false,
},
],
})),
},
],
},
property.hasDiscount
? {
tagName: "div",
attributes: {
class: "property-discount-badge pulse-animation",
style:
"width:fit-content; background-color: #ff4444; color: white; padding: 8px 12px; border-radius: 4px; position: absolute; top: 10px; right: 10px; font-weight: bold; z-index: 1;",
},
content: ${property.discountPercentage}% OFF,
copyable: false,
droppable: false,
draggable: false,
removable: false,
}
: null,
].filter(Boolean),
},
{
tagName: "div",
attributes: { class: "property-card-content" },
copyable: false,
droppable: false,
draggable: false,
removable: false,
components: [
{
tagName: "div",
attributes: { class: "property-card-header" },
copyable: false,
droppable: false,
draggable: false,
removable: false,
components: [
{
tagName: "h3",
attributes: { class: "property-card-title" },
content: property.title || "Premium Property",
copyable: false,
droppable: false,
draggable: false,
removable: false,
},
],
},
{
tagName: "div",
attributes: { class: "property-location" },
copyable: false,
droppable: false,
draggable: false,
removable: false,
components: [
{
tagName: "i",
attributes: { class: "bi bi-geo-alt" },
copyable: false,
droppable: false,
draggable: false,
removable: false,
},
{
tagName: "span",
content: property.address || "Location not specified",
copyable: false,
droppable: false,
draggable: false,
removable: false,
},
],
},
{
tagName: "div",
attributes: { class: "property-amenities" },
copyable: false,
droppable: false,
draggable: false,
removable: false,
components: (property.amenities || []).map((amenity) => ({
tagName: "span",
attributes: { class: "amenity-tag" },
content: amenity,
copyable: false,
droppable: false,
draggable: false,
removable: false,
})),
},
{
tagName: "div",
attributes: { class: "property-card-footer" },
copyable: false,
droppable: false,
draggable: false,
removable: false,
components: [
{
tagName: "div",
attributes: { class: "property-price" },
copyable: false,
droppable: false,
draggable: false,
removable: false,
components: [
property.discountPercentage
? {
tagName: "div",
attributes: { class: "price-wrapper" },
copyable: false,
droppable: false,
draggable: false,
removable: false,
components: [
{
tagName: "span",
attributes: {
class: "original-price",
style: "text-decoration: line-through; color: #999; margin-right: 8px;",
},
content: " " + (property.price || "Price on request"),
copyable: false,
droppable: false,
draggable: false,
removable: false,
},
{
tagName: "span",
attributes: {
class: "discounted-price price-amount",
},
content: property.price
? ` ${(property.price * (1 - property.discountPercentage / 100)).toFixed(
2
)}`
: "Price on request",
copyable: false,
droppable: false,
draggable: false,
removable: false,
},
],
}
: {
tagName: "span",
attributes: { class: "price-amount" },
content: property.price || "Price on request",
copyable: false,
droppable: false,
draggable: false,
removable: false,
},
{
tagName: "span",
attributes: { class: "price-description" },
content: "per night",
copyable: false,
droppable: false,
draggable: false,
removable: false,
},
],
},
],
},
],
},
],
}))
according to this structure
const skeleton = <div class="tp-product-card"> <div class="tp-product-image-container"> <img src="..." class="tp-product-image" style="background-color: #00000042" alt="" /> </div> <div class="p-2"> <h3 class="placeholder col-9" style="min-height: 14px; margin-bottom: 5px; background-color: #00000042" ></h3> <div class=""> <span class="placeholder col-10" style="min-height: 14px; margin-bottom: 5px; background-color: #00000042" ></span> </div> </div> </div>;
change this skeleton