import { h } from "preact";
import { Page } from "../../../page";
import Theme from "../../../theme";
import Navigation from "../../../navigation";
import ArrowLeft from "feather-icons/dist/icons/arrow-left.svg";

export default class SettingsPage extends Page<{ state: any }, { vault: string }> {
    componentWillMount() {

    }

    render() {
        return <div>
            <header class="header">
                <a class="header-icon-button" onClick={() => history.back()}><ArrowLeft height={undefined} width={undefined} /></a>
                <h3 style="display:inline" class="header-title" onClick={() => Navigation.setPage("/")}>Settings</h3>
                <span></span>
            </header>
            <div class="container">
                <button class="btn" onClick={() => Theme.toggle()}>Toggle Dark Mode</button>
                <button class="btn" onClick={() => window.navigator.serviceWorker.controller.postMessage("clear_cache")}>Clear cache</button>
            </div>
        </div >;
    }
}
