Skip to content

Commit c25de33

Browse files
Replace Next button with Close button for last category in dialog
1 parent e9b2a9e commit c25de33

1 file changed

Lines changed: 16 additions & 12 deletions

File tree

src/components/CategoryDialog.tsx

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -124,18 +124,22 @@ export const CategoryDialog: React.FC<CategoryDialogProps> = ({
124124
))}
125125
</div>
126126

127-
<button
128-
onClick={onNext}
129-
disabled={!hasNext}
130-
className={`flex items-center gap-2 px-4 py-2 rounded-lg font-medium transition-all duration-200 ${
131-
hasNext
132-
? 'bg-blue-600 text-white hover:bg-blue-700'
133-
: 'bg-gray-100 text-gray-400 cursor-not-allowed'
134-
}`}
135-
>
136-
Next
137-
<ChevronRight className="w-4 h-4" />
138-
</button>
127+
{hasNext ? (
128+
<button
129+
onClick={onNext}
130+
className="flex items-center gap-2 px-4 py-2 rounded-lg font-medium transition-all duration-200 bg-blue-600 text-white hover:bg-blue-700"
131+
>
132+
Next
133+
<ChevronRight className="w-4 h-4" />
134+
</button>
135+
) : (
136+
<button
137+
onClick={onClose}
138+
className="flex items-center gap-2 px-4 py-2 rounded-lg font-medium transition-all duration-200 bg-green-600 text-white hover:bg-green-700"
139+
>
140+
Close
141+
</button>
142+
)}
139143
</div>
140144
</div>
141145
</div>

0 commit comments

Comments
 (0)