Files
omni-tools/src/components/input/ToolTextInput.tsx

36 lines
962 B
TypeScript
Raw Normal View History

2024-06-22 22:06:16 +01:00
import { Box, Stack, TextField } from '@mui/material';
import Typography from '@mui/material/Typography';
import Button from '@mui/material/Button';
import PublishIcon from '@mui/icons-material/Publish';
import ContentPasteIcon from '@mui/icons-material/ContentPaste';
import React from 'react';
2024-06-21 20:06:07 +01:00
2024-06-22 22:06:16 +01:00
export default function ToolTextInput({
value,
onChange,
title = 'Input text'
}: {
2024-06-21 20:06:07 +01:00
title?: string;
2024-06-22 22:06:16 +01:00
value: string;
onChange: (value: string) => void;
2024-06-21 20:06:07 +01:00
}) {
return (
<Box>
<Typography fontSize={30} color={'primary'}>
{title}
</Typography>
<TextField
value={value}
onChange={(event) => onChange(event.target.value)}
fullWidth
multiline
rows={10}
/>
<Stack mt={1} direction={'row'} spacing={2}>
<Button startIcon={<PublishIcon />}>Import from file</Button>
<Button startIcon={<ContentPasteIcon />}>Copy to clipboard</Button>
</Stack>
</Box>
2024-06-22 22:06:16 +01:00
);
2024-06-21 20:06:07 +01:00
}