🐛 Fixed syntax error and hydration errors.

This commit is contained in:
sid
2024-10-26 11:53:23 +01:00
parent 8ec33644e0
commit 1d6058c2ae
6 changed files with 29 additions and 34 deletions

View File

@@ -1,3 +1,4 @@
'use client';
import React, { useState } from 'react';
import { Button } from '../ui/button'; // Adjust import path to where your shadcn Button component is located
@@ -20,7 +21,9 @@ const NumberPicker: React.FC<NumberPickerProps> = ({
if (count < max) {
const newCount = count + 1;
setCount(newCount);
onChange && onChange(newCount);
if (onChange) {
onChange(newCount);
}
}
};
@@ -28,7 +31,9 @@ const NumberPicker: React.FC<NumberPickerProps> = ({
if (count > min) {
const newCount = count - 1;
setCount(newCount);
onChange && onChange(newCount);
if (onChange) {
onChange(newCount);
}
}
};