@loafmarkets/ui 0.1.63 → 0.1.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +342 -213
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +342 -213
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -2709,6 +2709,11 @@ var ensureAnimationsInjected = () => {
|
|
|
2709
2709
|
@keyframes propertyNewsSpin {
|
|
2710
2710
|
to { transform: rotate(360deg); }
|
|
2711
2711
|
}
|
|
2712
|
+
|
|
2713
|
+
@keyframes propertyNewsFadeIn {
|
|
2714
|
+
from { opacity: 0; max-height: 0; }
|
|
2715
|
+
to { opacity: 1; max-height: 300px; }
|
|
2716
|
+
}
|
|
2712
2717
|
`;
|
|
2713
2718
|
document.head.appendChild(style);
|
|
2714
2719
|
};
|
|
@@ -2741,6 +2746,31 @@ var formatTimeAgo = (timestamp) => {
|
|
|
2741
2746
|
if (diff < 3600) return `${Math.floor(diff / 60)}m ago`;
|
|
2742
2747
|
return `${Math.floor(diff / 3600)}h ago`;
|
|
2743
2748
|
};
|
|
2749
|
+
function getSentimentInfo(score) {
|
|
2750
|
+
if (score == null) return null;
|
|
2751
|
+
if (score > 0.15) return { arrow: "\u25B2", label: "Bullish", color: "#0ecb81" };
|
|
2752
|
+
if (score < -0.15) return { arrow: "\u25BC", label: "Bearish", color: "#f6465d" };
|
|
2753
|
+
return { arrow: "\u2014", label: "Neutral", color: "#848e9c" };
|
|
2754
|
+
}
|
|
2755
|
+
function ChevronIcon({ isOpen }) {
|
|
2756
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2757
|
+
"svg",
|
|
2758
|
+
{
|
|
2759
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2760
|
+
width: "14",
|
|
2761
|
+
height: "14",
|
|
2762
|
+
viewBox: "0 0 24 24",
|
|
2763
|
+
fill: "currentColor",
|
|
2764
|
+
style: {
|
|
2765
|
+
color: "rgba(255,255,255,0.4)",
|
|
2766
|
+
transition: "transform 0.2s",
|
|
2767
|
+
transform: isOpen ? "rotate(90deg)" : "rotate(0deg)",
|
|
2768
|
+
flexShrink: 0
|
|
2769
|
+
},
|
|
2770
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z" })
|
|
2771
|
+
}
|
|
2772
|
+
);
|
|
2773
|
+
}
|
|
2744
2774
|
var PropertyNewsUpdates = React5__namespace.forwardRef(
|
|
2745
2775
|
({
|
|
2746
2776
|
className,
|
|
@@ -2763,6 +2793,7 @@ var PropertyNewsUpdates = React5__namespace.forwardRef(
|
|
|
2763
2793
|
const [homePage, setHomePage] = React5__namespace.useState(0);
|
|
2764
2794
|
const purchaseItems = purchasesProp ?? [];
|
|
2765
2795
|
const [page, setPage] = React5__namespace.useState(0);
|
|
2796
|
+
const [expandedId, setExpandedId] = React5__namespace.useState(null);
|
|
2766
2797
|
React5__namespace.useEffect(() => {
|
|
2767
2798
|
ensureAnimationsInjected();
|
|
2768
2799
|
}, []);
|
|
@@ -2784,6 +2815,9 @@ var PropertyNewsUpdates = React5__namespace.forwardRef(
|
|
|
2784
2815
|
[homeFilteredItems.length]
|
|
2785
2816
|
);
|
|
2786
2817
|
const homePaginatedItems = homeFilteredItems.slice(homePage * ITEMS_PER_PAGE, (homePage + 1) * ITEMS_PER_PAGE);
|
|
2818
|
+
const toggleExpand = React5__namespace.useCallback((key) => {
|
|
2819
|
+
setExpandedId((prev) => prev === key ? null : key);
|
|
2820
|
+
}, []);
|
|
2787
2821
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2788
2822
|
"div",
|
|
2789
2823
|
{
|
|
@@ -2901,229 +2935,324 @@ var PropertyNewsUpdates = React5__namespace.forwardRef(
|
|
|
2901
2935
|
},
|
|
2902
2936
|
tab
|
|
2903
2937
|
)) }),
|
|
2904
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
"
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
bottom: 0,
|
|
2935
|
-
width: `${barPercent}%`,
|
|
2936
|
-
background: "linear-gradient(90deg, transparent 0%, rgba(14,203,129,0.15) 100%)",
|
|
2937
|
-
pointerEvents: "none"
|
|
2938
|
-
}
|
|
2939
|
-
}
|
|
2940
|
-
),
|
|
2941
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", minWidth: 0, position: "relative" }, children: [
|
|
2942
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontWeight: 500, fontSize: "0.875rem", color: "#fff", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }, children: purchase.name }),
|
|
2943
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "0.7rem", color: "var(--color-text-secondary, #848e9c)", marginTop: "0.125rem" }, children: formatTimeAgo(purchase.timestamp) })
|
|
2944
|
-
] }),
|
|
2945
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontWeight: 600, fontSize: "0.875rem", color: "#fff", whiteSpace: "nowrap", marginLeft: "1rem", position: "relative" }, children: [
|
|
2946
|
-
"$",
|
|
2947
|
-
purchase.amount >= 1e6 ? `${(purchase.amount / 1e6).toFixed(2)}M` : Math.round(purchase.amount).toLocaleString()
|
|
2948
|
-
] })
|
|
2949
|
-
]
|
|
2950
|
-
},
|
|
2951
|
-
purchase.id
|
|
2952
|
-
);
|
|
2953
|
-
}) : /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", padding: "3rem 0", gap: "0.75rem" }, children: [
|
|
2954
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2955
|
-
"div",
|
|
2956
|
-
{
|
|
2957
|
-
style: {
|
|
2958
|
-
width: "28px",
|
|
2959
|
-
height: "28px",
|
|
2960
|
-
border: "3px solid rgba(255,255,255,0.1)",
|
|
2961
|
-
borderTopColor: "var(--color-accent, #f0b90b)",
|
|
2962
|
-
borderRadius: "50%",
|
|
2963
|
-
animation: "propertyNewsSpin 1s linear infinite"
|
|
2938
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-4 flex flex-1 flex-col gap-3 overflow-visible", children: isPurchaseVariant ? purchaseItems.length > 0 ? purchaseItems.slice(0, 7).map((purchase, index) => {
|
|
2939
|
+
const maxAmount = 6e4;
|
|
2940
|
+
const barPercent = Math.min(85, Math.max(15, purchase.amount / maxAmount * 100));
|
|
2941
|
+
const isAlternate = index % 2 === 1;
|
|
2942
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2943
|
+
"div",
|
|
2944
|
+
{
|
|
2945
|
+
style: {
|
|
2946
|
+
display: "flex",
|
|
2947
|
+
justifyContent: "space-between",
|
|
2948
|
+
alignItems: "center",
|
|
2949
|
+
padding: "0.625rem 0.75rem",
|
|
2950
|
+
borderBottom: "1px solid rgba(255,255,255,0.05)",
|
|
2951
|
+
position: "relative",
|
|
2952
|
+
overflow: "hidden",
|
|
2953
|
+
backgroundColor: isAlternate ? "rgba(255,255,255,0.03)" : "transparent"
|
|
2954
|
+
},
|
|
2955
|
+
children: [
|
|
2956
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2957
|
+
"div",
|
|
2958
|
+
{
|
|
2959
|
+
style: {
|
|
2960
|
+
position: "absolute",
|
|
2961
|
+
top: 0,
|
|
2962
|
+
right: 0,
|
|
2963
|
+
bottom: 0,
|
|
2964
|
+
width: `${barPercent}%`,
|
|
2965
|
+
background: "linear-gradient(90deg, transparent 0%, rgba(14,203,129,0.15) 100%)",
|
|
2966
|
+
pointerEvents: "none"
|
|
2967
|
+
}
|
|
2964
2968
|
}
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
},
|
|
3046
|
-
children: [
|
|
3047
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { style: { fontSize: "0.9375rem", fontWeight: 500, marginBottom: "0.35rem", color: "#fff" }, children: item.url ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3048
|
-
"a",
|
|
3049
|
-
{
|
|
3050
|
-
href: item.url,
|
|
3051
|
-
target: "_blank",
|
|
3052
|
-
rel: "noopener noreferrer",
|
|
3053
|
-
style: { color: "inherit", textDecoration: "none" },
|
|
3054
|
-
onMouseEnter: (e) => {
|
|
3055
|
-
e.currentTarget.style.textDecoration = "underline";
|
|
3056
|
-
},
|
|
3057
|
-
onMouseLeave: (e) => {
|
|
3058
|
-
e.currentTarget.style.textDecoration = "none";
|
|
3059
|
-
},
|
|
3060
|
-
children: item.title
|
|
3061
|
-
}
|
|
3062
|
-
) : item.title }),
|
|
3063
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3064
|
-
"div",
|
|
3065
|
-
{
|
|
3066
|
-
style: {
|
|
3067
|
-
display: "flex",
|
|
3068
|
-
justifyContent: "space-between",
|
|
3069
|
-
alignItems: "center",
|
|
3070
|
-
fontSize: "0.75rem",
|
|
3071
|
-
color: "#b5b8c5",
|
|
3072
|
-
gap: "0.5rem"
|
|
3073
|
-
},
|
|
3074
|
-
children: [
|
|
3075
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "0.5rem", minWidth: 0 }, children: [
|
|
3076
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: isHighlighted ? "#0ecb81" : "inherit", whiteSpace: "nowrap" }, children: dateLabel }),
|
|
3077
|
-
item.source && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3078
|
-
"span",
|
|
3079
|
-
{
|
|
3080
|
-
style: {
|
|
3081
|
-
padding: "0.15rem 0.45rem",
|
|
3082
|
-
borderRadius: "3px",
|
|
3083
|
-
fontSize: "0.65rem",
|
|
3084
|
-
fontWeight: 500,
|
|
3085
|
-
backgroundColor: "rgba(255,255,255,0.07)",
|
|
3086
|
-
color: "#848e9c",
|
|
3087
|
-
whiteSpace: "nowrap",
|
|
3088
|
-
overflow: "hidden",
|
|
3089
|
-
textOverflow: "ellipsis",
|
|
3090
|
-
maxWidth: "120px"
|
|
3091
|
-
},
|
|
3092
|
-
children: item.source
|
|
3093
|
-
}
|
|
3094
|
-
)
|
|
3095
|
-
] }),
|
|
2969
|
+
),
|
|
2970
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", minWidth: 0, position: "relative" }, children: [
|
|
2971
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontWeight: 500, fontSize: "0.875rem", color: "#fff", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }, children: purchase.name }),
|
|
2972
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "0.7rem", color: "var(--color-text-secondary, #848e9c)", marginTop: "0.125rem" }, children: formatTimeAgo(purchase.timestamp) })
|
|
2973
|
+
] }),
|
|
2974
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontWeight: 600, fontSize: "0.875rem", color: "#fff", whiteSpace: "nowrap", marginLeft: "1rem", position: "relative" }, children: [
|
|
2975
|
+
"$",
|
|
2976
|
+
purchase.amount >= 1e6 ? `${(purchase.amount / 1e6).toFixed(2)}M` : Math.round(purchase.amount).toLocaleString()
|
|
2977
|
+
] })
|
|
2978
|
+
]
|
|
2979
|
+
},
|
|
2980
|
+
purchase.id
|
|
2981
|
+
);
|
|
2982
|
+
}) : /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", padding: "3rem 0", gap: "0.75rem" }, children: [
|
|
2983
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2984
|
+
"div",
|
|
2985
|
+
{
|
|
2986
|
+
style: {
|
|
2987
|
+
width: "28px",
|
|
2988
|
+
height: "28px",
|
|
2989
|
+
border: "3px solid rgba(255,255,255,0.1)",
|
|
2990
|
+
borderTopColor: "var(--color-accent, #f0b90b)",
|
|
2991
|
+
borderRadius: "50%",
|
|
2992
|
+
animation: "propertyNewsSpin 1s linear infinite"
|
|
2993
|
+
}
|
|
2994
|
+
}
|
|
2995
|
+
),
|
|
2996
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "0.8rem", color: "rgba(255,255,255,0.4)" }, children: "Awaiting offering..." })
|
|
2997
|
+
] }) : isHomeVariant ? hasItems ? homePaginatedItems.map((item, index) => {
|
|
2998
|
+
const key = item.displayId ?? item.id ?? `${item.title}-${index}`;
|
|
2999
|
+
const tagType = item.type;
|
|
3000
|
+
const isProperty = tagType === "property";
|
|
3001
|
+
const sentimentInfo = getSentimentInfo(item.sentimentScore);
|
|
3002
|
+
const isExpanded = expandedId === key;
|
|
3003
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3004
|
+
"div",
|
|
3005
|
+
{
|
|
3006
|
+
style: {
|
|
3007
|
+
padding: "0.75rem 0",
|
|
3008
|
+
borderBottom: index < homePaginatedItems.length - 1 ? "1px solid rgba(255,255,255,0.05)" : "none"
|
|
3009
|
+
},
|
|
3010
|
+
children: [
|
|
3011
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3012
|
+
"button",
|
|
3013
|
+
{
|
|
3014
|
+
type: "button",
|
|
3015
|
+
onClick: () => toggleExpand(key),
|
|
3016
|
+
style: {
|
|
3017
|
+
width: "100%",
|
|
3018
|
+
textAlign: "left",
|
|
3019
|
+
background: "transparent",
|
|
3020
|
+
border: "none",
|
|
3021
|
+
cursor: "pointer",
|
|
3022
|
+
padding: 0,
|
|
3023
|
+
display: "flex",
|
|
3024
|
+
justifyContent: "space-between",
|
|
3025
|
+
alignItems: "flex-start",
|
|
3026
|
+
gap: "0.5rem",
|
|
3027
|
+
color: "inherit"
|
|
3028
|
+
},
|
|
3029
|
+
children: [
|
|
3030
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { flex: 1 }, children: [
|
|
3031
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { style: { fontSize: "0.85rem", fontWeight: 400, marginBottom: "0.25rem", color: "#f8f9fa", lineHeight: 1.4 }, children: item.title }),
|
|
3032
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", gap: "0.5rem", alignItems: "center", flexWrap: "wrap" }, children: [
|
|
3033
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "#848e9c", fontSize: "0.7rem" }, children: typeof item.date === "string" ? item.date : formatDate(item.date) }),
|
|
3034
|
+
item.source && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3035
|
+
"span",
|
|
3036
|
+
{
|
|
3037
|
+
style: {
|
|
3038
|
+
padding: "0.1rem 0.4rem",
|
|
3039
|
+
borderRadius: "3px",
|
|
3040
|
+
fontSize: "0.62rem",
|
|
3041
|
+
fontWeight: 500,
|
|
3042
|
+
backgroundColor: "rgba(255,255,255,0.07)",
|
|
3043
|
+
color: "#848e9c",
|
|
3044
|
+
whiteSpace: "nowrap"
|
|
3045
|
+
},
|
|
3046
|
+
children: item.source
|
|
3047
|
+
}
|
|
3048
|
+
),
|
|
3096
3049
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3097
3050
|
"span",
|
|
3098
3051
|
{
|
|
3099
3052
|
style: {
|
|
3100
|
-
padding: "0.
|
|
3101
|
-
borderRadius: "
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3053
|
+
padding: "0.15rem 0.4rem",
|
|
3054
|
+
borderRadius: "2px",
|
|
3055
|
+
fontSize: "0.65rem",
|
|
3056
|
+
fontWeight: 500,
|
|
3057
|
+
backgroundColor: isProperty ? "rgba(14,203,129,0.1)" : "rgba(240,185,11,0.1)",
|
|
3058
|
+
color: isProperty ? "#0ecb81" : "#f0b90b"
|
|
3059
|
+
},
|
|
3060
|
+
children: isProperty ? "Property Update" : "Market News"
|
|
3061
|
+
}
|
|
3062
|
+
),
|
|
3063
|
+
sentimentInfo && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3064
|
+
"span",
|
|
3065
|
+
{
|
|
3066
|
+
style: {
|
|
3067
|
+
fontSize: "0.65rem",
|
|
3106
3068
|
fontWeight: 600,
|
|
3107
|
-
|
|
3108
|
-
whiteSpace: "nowrap",
|
|
3109
|
-
flexShrink: 0
|
|
3069
|
+
color: sentimentInfo.color
|
|
3110
3070
|
},
|
|
3111
|
-
children:
|
|
3071
|
+
children: [
|
|
3072
|
+
sentimentInfo.arrow,
|
|
3073
|
+
" ",
|
|
3074
|
+
sentimentInfo.label
|
|
3075
|
+
]
|
|
3112
3076
|
}
|
|
3113
3077
|
)
|
|
3114
|
-
]
|
|
3078
|
+
] })
|
|
3079
|
+
] }),
|
|
3080
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", alignItems: "center", color: "#848e9c", marginLeft: "0.5rem", paddingTop: "2px" }, children: /* @__PURE__ */ jsxRuntime.jsx(ChevronIcon, { isOpen: isExpanded }) })
|
|
3081
|
+
]
|
|
3082
|
+
}
|
|
3083
|
+
),
|
|
3084
|
+
isExpanded && item.summary && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3085
|
+
"div",
|
|
3086
|
+
{
|
|
3087
|
+
style: {
|
|
3088
|
+
marginTop: "0.625rem",
|
|
3089
|
+
padding: "0.75rem",
|
|
3090
|
+
background: "rgba(255,255,255,0.04)",
|
|
3091
|
+
borderRadius: "6px",
|
|
3092
|
+
borderLeft: `3px solid ${sentimentInfo?.color ?? "rgba(255,255,255,0.15)"}`,
|
|
3093
|
+
animation: "propertyNewsSlideIn 0.2s ease-out"
|
|
3094
|
+
},
|
|
3095
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("p", { style: { fontSize: "0.8rem", color: "rgba(255,255,255,0.72)", lineHeight: 1.65, margin: 0 }, children: item.summary })
|
|
3096
|
+
}
|
|
3097
|
+
),
|
|
3098
|
+
isExpanded && !item.summary && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3099
|
+
"div",
|
|
3100
|
+
{
|
|
3101
|
+
style: {
|
|
3102
|
+
marginTop: "0.625rem",
|
|
3103
|
+
padding: "0.6rem 0.75rem",
|
|
3104
|
+
background: "rgba(255,255,255,0.03)",
|
|
3105
|
+
borderRadius: "6px",
|
|
3106
|
+
animation: "propertyNewsSlideIn 0.2s ease-out"
|
|
3107
|
+
},
|
|
3108
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("p", { style: { fontSize: "0.78rem", color: "rgba(255,255,255,0.35)", fontStyle: "italic", margin: 0 }, children: "Summary not available for this article." })
|
|
3109
|
+
}
|
|
3110
|
+
)
|
|
3111
|
+
]
|
|
3112
|
+
},
|
|
3113
|
+
key
|
|
3114
|
+
);
|
|
3115
|
+
}) : emptyState ?? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col items-center justify-center py-10 text-center text-sm text-white/60", children: "No property news yet." }) : hasItems ? paginatedItems.map((item, index) => {
|
|
3116
|
+
const absoluteIndex = page * ITEMS_PER_PAGE + index;
|
|
3117
|
+
const key = item.displayId ?? item.id ?? `${item.title}-${absoluteIndex}`;
|
|
3118
|
+
const styles2 = categoryStyles[item.type] ?? categoryStyles.market;
|
|
3119
|
+
const dateLabel = item.isNew ?? (highlightFirst && absoluteIndex === 0) ? "Just now" : typeof item.date === "string" && item.date.trim().length > 0 ? item.date : formatDate(item.date);
|
|
3120
|
+
const isHighlighted = item.isNew ?? (highlightFirst && absoluteIndex === 0);
|
|
3121
|
+
const sentimentInfo = getSentimentInfo(item.sentimentScore);
|
|
3122
|
+
const isExpanded = expandedId === key;
|
|
3123
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3124
|
+
"div",
|
|
3125
|
+
{
|
|
3126
|
+
style: {
|
|
3127
|
+
borderRadius: "6px",
|
|
3128
|
+
backgroundColor: isHighlighted ? "rgba(14, 203, 129, 0.1)" : "transparent",
|
|
3129
|
+
border: "1px solid transparent",
|
|
3130
|
+
transition: "background-color 0.2s",
|
|
3131
|
+
animation: item.isNew ? "propertyNewsSlideIn 0.5s ease-out" : void 0
|
|
3132
|
+
},
|
|
3133
|
+
children: [
|
|
3134
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3135
|
+
"button",
|
|
3136
|
+
{
|
|
3137
|
+
type: "button",
|
|
3138
|
+
onClick: () => toggleExpand(key),
|
|
3139
|
+
style: {
|
|
3140
|
+
width: "100%",
|
|
3141
|
+
textAlign: "left",
|
|
3142
|
+
background: "transparent",
|
|
3143
|
+
border: "none",
|
|
3144
|
+
cursor: "pointer",
|
|
3145
|
+
padding: "0.75rem",
|
|
3146
|
+
display: "block",
|
|
3147
|
+
color: "inherit"
|
|
3148
|
+
},
|
|
3149
|
+
children: [
|
|
3150
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "flex-start", gap: "0.5rem", marginBottom: "0.35rem" }, children: [
|
|
3151
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: { fontSize: "0.9375rem", fontWeight: 500, color: "#fff", margin: 0, flex: 1, lineHeight: 1.4 }, children: item.title }),
|
|
3152
|
+
/* @__PURE__ */ jsxRuntime.jsx(ChevronIcon, { isOpen: isExpanded })
|
|
3153
|
+
] }),
|
|
3154
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3155
|
+
"div",
|
|
3156
|
+
{
|
|
3157
|
+
style: {
|
|
3158
|
+
display: "flex",
|
|
3159
|
+
justifyContent: "space-between",
|
|
3160
|
+
alignItems: "center",
|
|
3161
|
+
fontSize: "0.75rem",
|
|
3162
|
+
color: "#b5b8c5",
|
|
3163
|
+
gap: "0.5rem"
|
|
3164
|
+
},
|
|
3165
|
+
children: [
|
|
3166
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "0.5rem", minWidth: 0, flexWrap: "wrap" }, children: [
|
|
3167
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: isHighlighted ? "#0ecb81" : "inherit", whiteSpace: "nowrap" }, children: dateLabel }),
|
|
3168
|
+
item.source && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3169
|
+
"span",
|
|
3170
|
+
{
|
|
3171
|
+
style: {
|
|
3172
|
+
padding: "0.15rem 0.45rem",
|
|
3173
|
+
borderRadius: "3px",
|
|
3174
|
+
fontSize: "0.65rem",
|
|
3175
|
+
fontWeight: 500,
|
|
3176
|
+
backgroundColor: "rgba(255,255,255,0.07)",
|
|
3177
|
+
color: "#848e9c",
|
|
3178
|
+
whiteSpace: "nowrap",
|
|
3179
|
+
overflow: "hidden",
|
|
3180
|
+
textOverflow: "ellipsis",
|
|
3181
|
+
maxWidth: "120px"
|
|
3182
|
+
},
|
|
3183
|
+
children: item.source
|
|
3184
|
+
}
|
|
3185
|
+
),
|
|
3186
|
+
sentimentInfo && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3187
|
+
"span",
|
|
3188
|
+
{
|
|
3189
|
+
style: {
|
|
3190
|
+
fontSize: "0.65rem",
|
|
3191
|
+
fontWeight: 700,
|
|
3192
|
+
color: sentimentInfo.color,
|
|
3193
|
+
whiteSpace: "nowrap"
|
|
3194
|
+
},
|
|
3195
|
+
children: [
|
|
3196
|
+
sentimentInfo.arrow,
|
|
3197
|
+
" ",
|
|
3198
|
+
sentimentInfo.label
|
|
3199
|
+
]
|
|
3200
|
+
}
|
|
3201
|
+
)
|
|
3202
|
+
] }),
|
|
3203
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3204
|
+
"span",
|
|
3205
|
+
{
|
|
3206
|
+
style: {
|
|
3207
|
+
padding: "0.25rem 0.6rem",
|
|
3208
|
+
borderRadius: "4px",
|
|
3209
|
+
border: `1px solid ${styles2.borderColor}`,
|
|
3210
|
+
backgroundColor: styles2.backgroundColor,
|
|
3211
|
+
color: styles2.color,
|
|
3212
|
+
fontSize: "0.68rem",
|
|
3213
|
+
fontWeight: 600,
|
|
3214
|
+
textTransform: "uppercase",
|
|
3215
|
+
whiteSpace: "nowrap",
|
|
3216
|
+
flexShrink: 0
|
|
3217
|
+
},
|
|
3218
|
+
children: item.type === "property" ? styles2.label : "Market News"
|
|
3219
|
+
}
|
|
3220
|
+
)
|
|
3221
|
+
]
|
|
3222
|
+
}
|
|
3223
|
+
)
|
|
3224
|
+
]
|
|
3225
|
+
}
|
|
3226
|
+
),
|
|
3227
|
+
isExpanded && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3228
|
+
"div",
|
|
3229
|
+
{
|
|
3230
|
+
style: {
|
|
3231
|
+
padding: "0 0.75rem 0.75rem",
|
|
3232
|
+
animation: "propertyNewsSlideIn 0.2s ease-out"
|
|
3233
|
+
},
|
|
3234
|
+
children: item.summary ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3235
|
+
"div",
|
|
3236
|
+
{
|
|
3237
|
+
style: {
|
|
3238
|
+
padding: "0.75rem",
|
|
3239
|
+
background: "rgba(255,255,255,0.04)",
|
|
3240
|
+
borderRadius: "6px",
|
|
3241
|
+
borderLeft: `3px solid ${sentimentInfo?.color ?? "rgba(255,255,255,0.15)"}`
|
|
3242
|
+
},
|
|
3243
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("p", { style: { fontSize: "0.85rem", color: "rgba(255,255,255,0.78)", lineHeight: 1.65, margin: 0 }, children: item.summary })
|
|
3115
3244
|
}
|
|
3116
|
-
)
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
),
|
|
3245
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("p", { style: { fontSize: "0.78rem", color: "rgba(255,255,255,0.3)", fontStyle: "italic", margin: 0 }, children: "Summary not available for this article." })
|
|
3246
|
+
}
|
|
3247
|
+
)
|
|
3248
|
+
]
|
|
3249
|
+
},
|
|
3250
|
+
key
|
|
3251
|
+
);
|
|
3252
|
+
}) : emptyState ?? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center rounded-2xl border border-dashed border-white/20 px-6 py-10 text-center text-sm text-white/60", children: [
|
|
3253
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Newspaper, { className: "mb-3 h-8 w-8 text-white/40" }),
|
|
3254
|
+
"No property news yet. Updates will land here as soon as we receive new intelligence."
|
|
3255
|
+
] }) }),
|
|
3127
3256
|
isHomeVariant && homeTotalPages > 1 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-3 flex items-center justify-between text-xs text-white/60", children: [
|
|
3128
3257
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3129
3258
|
"button",
|