import * as React from 'react'; import { Dialog, Surface, Text } from 'react-native-paper'; import { TextInputDialogData } from './types'; import { StyleSheet, ViewStyle } from 'react-native'; import { useId, useMemo, useState } from 'react'; import PromptButton from './PromptButton'; import { _ } from '@joplin/lib/locale'; import TextInput from '../TextInput'; interface Props { dialog: TextInputDialogData; containerStyle: ViewStyle; themeId: number; } const useStyles = () => { return useMemo(() => { return StyleSheet.create({ dialogContent: { paddingBottom: 14, }, dialogActions: { paddingBottom: 14, paddingTop: 4, }, }); }, []); }; const TextInputDialog: React.FC = ({ dialog, containerStyle, themeId }) => { const styles = useStyles(); const [text, setText] = useState(''); const labelId = useId(); return ( {dialog.message} dialog.onSubmit(text), }} themeId={themeId} /> ); }; export default TextInputDialog;