import bug fix #47

Merged
amit merged 1 commits from fix/module-builder-import-fix into main 2026-11-27 04:49:09 +00:00
1 changed files with 10 additions and 15 deletions
Showing only changes of commit 8a1de005f2 - Show all commits

View File

@ -1119,9 +1119,8 @@ export const ModuleBuilderTabContent: React.FC = () => {
key={m.code}
type="button"
onClick={() => handleSwitchModule(m.code)}
className={`w-full text-left px-3.5 py-2.5 flex items-center justify-between hover:bg-indigo-50/50 transition-colors ${
m.code === moduleCode ? 'bg-indigo-50/70 text-indigo-900 font-bold' : 'text-slate-700'
}`}
className={`w-full text-left px-3.5 py-2.5 flex items-center justify-between hover:bg-indigo-50/50 transition-colors ${m.code === moduleCode ? 'bg-indigo-50/70 text-indigo-900 font-bold' : 'text-slate-700'
}`}
>
<div>
<div className="text-xs font-bold flex items-center gap-1.5">
@ -1650,11 +1649,10 @@ export const ModuleBuilderTabContent: React.FC = () => {
{patterns.map((pat, idx) => (
<div
key={idx}
className={`flex items-center gap-1 px-3 py-1.5 rounded-xl text-xs font-bold transition-all cursor-pointer ${
safePatternIndex === idx
className={`flex items-center gap-1 px-3 py-1.5 rounded-xl text-xs font-bold transition-all cursor-pointer ${safePatternIndex === idx
? 'bg-indigo-600 text-white shadow-sm shadow-indigo-600/30'
: 'bg-slate-100 hover:bg-slate-200 text-slate-700'
}`}
}`}
onClick={() => {
setActivePatternIndex(idx);
if (error) setError(null);
@ -1668,9 +1666,8 @@ export const ModuleBuilderTabContent: React.FC = () => {
e.stopPropagation();
handleRemovePattern(idx);
}}
className={`h-4 w-4 rounded-full flex items-center justify-center hover:bg-black/10 transition-colors ml-1 ${
safePatternIndex === idx ? 'text-white' : 'text-slate-400 hover:text-slate-700'
}`}
className={`h-4 w-4 rounded-full flex items-center justify-center hover:bg-black/10 transition-colors ml-1 ${safePatternIndex === idx ? 'text-white' : 'text-slate-400 hover:text-slate-700'
}`}
title="Delete pattern"
>
<X className="h-2.5 w-2.5" />
@ -1920,11 +1917,10 @@ export const ModuleBuilderTabContent: React.FC = () => {
type="button"
onClick={() => handleAddPointChip(pt)}
disabled={isAdded}
className={`text-[10px] font-bold px-2 py-0.5 rounded-lg border transition-all ${
isAdded
className={`text-[10px] font-bold px-2 py-0.5 rounded-lg border transition-all ${isAdded
? 'bg-slate-200 text-slate-400 border-slate-200 cursor-default'
: 'bg-white hover:bg-indigo-50 border-slate-200 hover:border-indigo-300 text-slate-700 hover:text-indigo-600'
}`}
}`}
>
+{pt}
</button>
@ -2090,11 +2086,10 @@ export const ModuleBuilderTabContent: React.FC = () => {
key={idx}
type="button"
onClick={() => setPreviewPatternIdx(idx)}
className={`px-3 py-1.5 rounded-xl text-xs font-bold transition-all ${
previewPatternIdx === idx
className={`px-3 py-1.5 rounded-xl text-xs font-bold transition-all ${previewPatternIdx === idx
? 'bg-indigo-600 text-white shadow-xs'
: 'bg-slate-100 hover:bg-slate-200 text-slate-700'
}`}
}`}
>
{p.name || `Pattern ${idx + 1}`}
</button>