import { Alert, Button, Host, Spacer, Text, TextField } from '@expo/ui/swift-ui'; import { frame, keyboardType } from '@expo/ui/swift-ui/modifiers'; import { useState } from 'react'; import { StyleSheet } from 'react-native'; import { parseLine } from './lineInput'; import type { GoToLineProps } from './types'; // A system alert with one field; Go is a no-op until the number is inside the document. // The alert presents from its trigger view, so an unseen zero-size one stands in for a button. export function GoToLine({ scheme, open, lineCount, onClose, onGo }: GoToLineProps) { const [text, setText] = useState(''); const go = () => { const line = parseLine(text, lineCount); onClose(); if (line !== null) onGo(line); }; return ( { if (!presented) onClose(); }} > {`1 to ${lineCount}`} {/* biome-ignore lint/a11y/useValidAriaRole: a SwiftUI button role, not an ARIA role */}