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

	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>
