mirror of
https://github.com/idanoo/autobrr
synced 2025-07-25 17:59:14 +00:00
feat: add webui
This commit is contained in:
parent
a838d994a6
commit
773e57afe6
59 changed files with 19794 additions and 0 deletions
9
web/src/hooks/hooks.ts
Normal file
9
web/src/hooks/hooks.ts
Normal file
|
@ -0,0 +1,9 @@
|
|||
import React from "react";
|
||||
|
||||
export function useToggle(initialValue: boolean = false): [boolean, () => void] {
|
||||
const [value, setValue] = React.useState<boolean>(initialValue);
|
||||
const toggle = React.useCallback(() => {
|
||||
setValue(v => !v);
|
||||
}, []);
|
||||
return [value, toggle];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue