live change value text

This commit is contained in:
hamid zarghami
2026-01-08 09:02:22 +03:30
parent 879c086069
commit 985c79b96b
2 changed files with 47 additions and 61 deletions
@@ -12,12 +12,21 @@ const getFontFamily = (fontFamily?: string): string => {
};
const getFontWeight = (fontWeight?: string): string => {
if (!fontWeight) return "normal";
// اگر عدد است، مستقیماً برگردان
const numValue = parseInt(fontWeight);
if (!isNaN(numValue)) {
return numValue.toString();
}
// برای مقادیر string قدیمی
const weightMap: Record<string, string> = {
bold: "bold",
normal: "normal",
"300": "300",
};
return weightMap[fontWeight || "normal"] || "normal";
return weightMap[fontWeight] || "normal";
};
const getColorWithOpacity = (fill?: string, opacity?: number): string => {