refactor(react/settings): add names to all form groups

This commit is contained in:
Elian Doran
2025-08-19 23:34:25 +03:00
parent 51291a61e6
commit 1d7799f981
29 changed files with 144 additions and 154 deletions

View File

@@ -190,6 +190,6 @@ export function useTriliumOptions<T extends OptionNames>(...names: T[]) {
* @param prefix a prefix to add to the unique name.
* @returns a name with the given prefix and a random alpanumeric string appended to it.
*/
export function useUniqueName(prefix: string) {
return useMemo(() => prefix + "-" + utils.randomString(10), [ prefix]);
export function useUniqueName(prefix?: string) {
return useMemo(() => (prefix ? prefix + "-" : "") + utils.randomString(10), [ prefix ]);
}