import React from 'react';
import CharLimit from './decorators/CharLimit'
import styled from 'styled-components'
import FloatingLabel from './decorators/FloatingLabel'
import Dropdown from 'react-dropdown';
import { LANGS, THEMES } from './renderers/Code';
const RelPositioning = styled.div`
position: relative;
height: calc(100% - 4em);
`
const FlexChild = styled.div`
display: block;
margin-left: 2em;
`
const TitleInput = (props) => {
return (
);
}
const PasteInput = (props) => {
function handleKeyDown(e) {
if (e.keyCode === 9) { // tab was pressed
// prevent autofocus on next intput
e.preventDefault();
// get selection start and end
const start = e.target.selectionStart
const end = e.target.selectionEnd
props.insertTabCallback(start, end)
// set cursor position to be at start
e.target.selectionEnd = end + 4;
}
}
return (
);
}
const PassInput = (props) => {
return (
);
}
const GenericDropdown = (props) => {
function _onSelect(option) {
props.onChange({
target: {
name: props.label,
value: option.label
}
});
}
return (
);
}
const ExpiryInput = (props) => {
const options = [
'5 years',
'1 year',
'1 month',
'1 week',
'1 day',
'1 hour',
'10 min',
];
return (
);
}
const LangInput = (props) => {
const options = Object.entries(LANGS).map((key, _) => {
return {
'value': key[1],
'label': key[0]
}
})
return (
);
}
const ThemeInput = (props) => {
const options = Object.entries(THEMES).map((key, _) => {
return {
'value': key[1],
'label': key[0]
}
})
return (
);
}
const PasteURLInput = ({id, fullURL}) => {
return (
);
}
export { TitleInput, PasteInput, PassInput, ExpiryInput, PasteURLInput, LangInput, ThemeInput }