import { render } from 'solid-js/web'; import { IconChevronLeft } from '@mdui/icons/chevron-left.js'; import { IconChevronRight } from '@mdui/icons/chevron-right.js'; import { createPlugin } from '@/utils'; import { t } from '@/i18n'; export default createPlugin({ name: () => t('plugins.navigation.name'), description: () => t('plugins.navigation.description'), restartNeeded: false, config: { enabled: true, }, renderer: { buttonContainer: document.createElement('div'), start() { const doNotTreeShake = [IconChevronLeft, IconChevronRight]; ((a) => {})(doNotTreeShake); if (!this.buttonContainer) { this.buttonContainer = document.createElement('div'); } render( () => ( <> history.back()}> history.forward()}> ), this.buttonContainer, ); const menu = document.querySelector('#right-content'); menu?.prepend(this.buttonContainer); }, stop() { this.buttonContainer.remove(); }, }, });