import React from 'react'; import { createPortal } from 'react-dom'; import { ArrowDown, ArrowUp, IndentDecrease, IndentIncrease } from 'lucide-react'; import { useKeyboardInset } from '../../lib/useKeyboardInset'; // Phones and tablets have no Tab key: while a bullet is being edited, a slim bar sits right above the // on-screen keyboard (only while it is open) with outdent / indent and move up / down (the bullet takes its children along). export const isTouchOnly = typeof window !== 'undefined' && !!window.matchMedia?.('(hover: none) and (pointer: coarse)').matches && !window.matchMedia?.('(any-pointer: fine)').matches; interface MobileOutlineBarProps { onOutdent: () => void; onIndent: () => void; onMoveUp: () => void; onMoveDown: () => void; } export const MobileOutlineBar: React.FC = ({ onOutdent, onIndent, onMoveUp, onMoveDown }) => { // iOS keeps fixed elements behind the keyboard: lift the bar by the keyboard's height const { inset, keyboardOpen } = useKeyboardInset(); const button = (label: string, icon: React.ReactNode, action: () => void) => ( ); // Keyboard closed (e.g. back button) while the bullet keeps its focus: no bar over the bottom navigation if (!keyboardOpen) return null; return createPortal(
{button('Ausrücken', , onOutdent)} {button('Einrücken', , onIndent)} {button('Nach oben', , onMoveUp)} {button('Nach unten', , onMoveDown)}
, document.body ); };