hookshot/web/components/elements/EventHookCheckbox.tsx
Will Hunt 819c089aa4
Update minimum Node version to 22 (#990)
* Update dependencies

* Node 22 is now the new minimum version.

* changelog.

* Begin porting eslint to new config format.

* Make linter happy.

* Update reqwest to fix SSL issue?

* Fix test types

* quick check on ubuntu LTS 24.04

* Change cache key

* update rust action

* revert mocha due to esminess

* Remove the only usage of pqueue

* Use babel for TS transformations to get around ESM import bug.

* Dependency bundle upgrade

* Drop babel, not actually used.

* lint

* lint

* update default config (mostly sections moving around)
2024-11-28 15:04:01 +00:00

22 lines
723 B
TypeScript

import { FunctionComponent } from "preact";
import { JSXInternal } from "preact/src/jsx";
export const EventHookCheckbox: FunctionComponent<{
enabledHooks: string[],
onChange: JSXInternal.GenericEventHandler<HTMLInputElement>,
hookEventName: string,
parentEvent?: string,
}> = ({enabledHooks, onChange, hookEventName, parentEvent, children}) => {
const checked = enabledHooks.includes(hookEventName) || (!!parentEvent && enabledHooks.includes(parentEvent));
return <li>
<label>
<input
type="checkbox"
data-event-name={hookEventName}
checked={checked}
onChange={onChange} />
{ children }
</label>
</li>;
};