<script lang="ts">
	import { accelerator } from '$lib/Shortcuts';
	import { getReaderContext } from '../Reader.svelte';

	const reader = getReaderContext();

	function onclick() {
		reader.visible = false;
		reader.sidebar = false;
	}
</script>

<button
	type="button"
	class="btn floating"
	title="Close reader"
	aria-label="Close reader"
	{onclick}
	use:accelerator={'Escape'}
>
	<span class="icon-lg icon-[material-symbols--close]"></span>
</button>
