chore(react/ribbon): working execute search button

This commit is contained in:
Elian Doran
2025-08-24 15:48:53 +03:00
parent c1b30db3d1
commit 759398d804
17 changed files with 104 additions and 68 deletions

View File

@@ -1,22 +1,26 @@
interface FormTextAreaProps {
import { TextareaHTMLAttributes } from "preact/compat";
interface FormTextAreaProps extends Omit<TextareaHTMLAttributes, "onBlur" | "onChange"> {
id?: string;
currentValue: string;
onChange?(newValue: string): void;
onBlur?(newValue: string): void;
rows: number;
className?: string;
placeholder?: string;
}
export default function FormTextArea({ id, onBlur, rows, currentValue, className, placeholder }: FormTextAreaProps) {
export default function FormTextArea({ id, onBlur, onChange, rows, currentValue, className, ...restProps }: FormTextAreaProps) {
return (
<textarea
id={id}
rows={rows}
className={`form-control ${className ?? ""}`}
onChange={(e) => {
onChange?.(e.currentTarget.value);
}}
onBlur={(e) => {
onBlur?.(e.currentTarget.value);
}}
style={{ width: "100%" }}
placeholder={placeholder}
{...restProps}
>{currentValue}</textarea>
)
}

View File

@@ -109,7 +109,7 @@ export function useTriliumEventBeta<T extends EventNames>(eventName: T | T[], ha
}
}
export function useSpacedUpdate(callback: () => Promise<void>, interval = 1000) {
export function useSpacedUpdate(callback: () => void | Promise<void>, interval = 1000) {
const callbackRef = useRef(callback);
const spacedUpdateRef = useRef<SpacedUpdate>();