Skip to content

Commit 01bd32f

Browse files
committed
Fix: Update uppercaseFirstLetter function to handle non-string inputs and ensure consistent value rendering in filter component.
1 parent ea26acf commit 01bd32f

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

lib/components/event-schedule-new/filter.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,10 @@ const filterKeyToLabel = (key: string) => {
153153
return key;
154154
};
155155

156-
const uppercaseFirstLetter = (str: string) => {
156+
const uppercaseFirstLetter = (str: any) => {
157+
if (typeof str !== 'string') {
158+
return String(str);
159+
}
157160
return str.charAt(0).toUpperCase() + str.slice(1);
158161
};
159162

@@ -248,7 +251,7 @@ export const Filter = ({
248251
onClick={() => setFilter(filterStateKey, value)}
249252
>
250253
<Checkbox checked={isSelected} className="mb-0.5" />
251-
{uppercaseFirstLetter(value)}
254+
{typeof value === 'string' ? uppercaseFirstLetter(value) : String(value)}
252255
</div>
253256
);
254257
})}

0 commit comments

Comments
 (0)