import {html} from 'htm/preact';
import {useContext} from 'preact/hooks';
import {AppContext, TRXComponent} from '../..';
export type SettingProps = {
children: TRXComponent | undefined;
class: string;
enabled: boolean;
feature: string;
title: string;
};
function toggleFeature(feature: string) {
const {toggleFeature: toggle} = useContext(AppContext);
toggle(feature);
}
function Header(props: SettingProps): TRXComponent {
const enabled = props.enabled ? 'Enabled' : 'Disabled';
return html`${props.title}
This setting still needs a component!
` : props.children; const enabled = (props.enabled ? 'Enabled' : 'Disabled').toLowerCase(); return html`