This commit is contained in:
2025-11-14 02:35:17 +01:00
parent 6f4ff68062
commit a3c5494bf7
53 changed files with 269 additions and 340 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ const normalizeEntries = (entries) =>
}
const id = entry.id ?? entry.value ?? index;
const label = entry.label ?? entry.name ?? entry.title ?? '';
const onClick = typeof entry.onClick === 'function' ? entry.onClick : null;
const onClick = entry.onClick ? entry.onClick : null;
return label ? { id, label, onClick, raw: entry } : null;
})
.filter(Boolean);
+2 -1
View File
@@ -1,6 +1,7 @@
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import type { CSSProperties, ReactNode, FormEvent, MutableRefObject } from 'react';
import { PlusIcon } from './icons';
import { isPlainObject } from '../utils/typeGuards';
import useFloatingMenu from './useFloatingMenu';
type QuickAddOption = string | number | { id?: string | number; label?: string; name?: string; [key: string]: unknown };
@@ -16,7 +17,7 @@ const normalizeOption = (option: QuickAddOption | null | undefined, index: numbe
if (option == null) {
return null;
}
if (typeof option === 'object') {
if (isPlainObject(option)) {
const label = option.label ?? option.name;
if (label == null) {
return null;
+1 -1
View File
@@ -87,7 +87,7 @@ export const EditIcon: TablerIconComponent = ({ className, size = '1em', stroke
);
export const FolderIcon: TablerIconComponent = ({ className, size = 16, title, ...rest }) => {
const dimensionProps = typeof size === 'number' ? { width: size, height: size } : {};
const dimensionProps = Number.isFinite(size) ? { width: Number(size), height: Number(size) } : {};
return (
<FolderSvg