fix(frontend): enhance species badges, smart symptom matching, and sync charity total
This commit is contained in:
1 parent
330d960502
commit
30fb8f3e83
18 files changed
+16952
-14903
No files matched your search
@@ -60,9 +60,14 @@ const getFormBadge = (unit?: string, name?: string) => {
|
||||
|
||||
// Helper for pet target species icon
|
||||
const getSpeciesBadge = (suitableFor?: string) => {
|
||||
if (suitableFor === "سگ") return { label: "مخصوص سگ", icon: Dog };
|
||||
if (suitableFor === "گربه") return { label: "مخصوص گربه", icon: Cat };
|
||||
return { label: "سگ و گربه", icon: Heart };
|
||||
const s = (suitableFor || "").trim().toLowerCase();
|
||||
const isDog = s === "سگ" || s.includes("سگ") || s.includes("dog");
|
||||
const isCat = s === "گربه" || s.includes("گربه") || s.includes("cat");
|
||||
const isBoth = s.includes("هر دو") || s.includes("both") || (isDog && isCat);
|
||||
|
||||
if (isBoth) return { label: "سگ و گربه", isBoth: true, icon: Dog, iconCat: Cat };
|
||||
if (isCat) return { label: "مخصوص گربه", isBoth: false, icon: Cat };
|
||||
return { label: "مخصوص سگ", isBoth: false, icon: Dog };
|
||||
};
|
||||
|
||||
export default function CatalogPageSpread({
|
||||
@@ -380,7 +385,14 @@ export default function CatalogPageSpread({
|
||||
{/* Product Badges (Strictly whitespace-nowrap) */}
|
||||
<div className="flex items-center gap-1 sm:gap-1.5 text-[9px] font-bold shrink-0">
|
||||
<span className="bg-white text-slate-700 px-2 py-0.5 rounded-md flex items-center gap-1 border border-slate-200 shadow-3xs whitespace-nowrap">
|
||||
<SpeciesIcon className="w-3 h-3 text-slate-500 shrink-0" />
|
||||
{speciesBadge.isBoth ? (
|
||||
<span className="flex items-center gap-0.5">
|
||||
<Dog className="w-3 h-3 text-slate-500 shrink-0" />
|
||||
<Cat className="w-3 h-3 text-slate-500 shrink-0" />
|
||||
</span>
|
||||
) : (
|
||||
<SpeciesIcon className="w-3 h-3 text-slate-500 shrink-0" />
|
||||
)}
|
||||
<span className="whitespace-nowrap">{speciesBadge.label}</span>
|
||||
</span>
|
||||
<span className="bg-white text-slate-700 px-2 py-0.5 rounded-md flex items-center gap-1 border border-slate-200 shadow-3xs whitespace-nowrap">
|
||||
|
||||
Reference in new issue
Block a user