Skip to content

Commit

Permalink
ahh I forget to track file after rename
Browse files Browse the repository at this point in the history
  • Loading branch information
nvcnvn committed Dec 29, 2023
1 parent ccdc6cb commit 3d77efd
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions src/components/DateTimePicker.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import React from 'react'
import PropTypes from 'prop-types'
import { Input, Dropdown } from 'semantic-ui-react'

export const DateTimePicker = ({ type, value, onChange }) => {
return (
<div className="pa2 flex flex-wrap justify-between">
<Dropdown
clearable
options={[
{
key: 0,
text: 'Nonspecific time',
value: -1,
},
{
key: 1,
text: 'Leave now',
value: 0,
},
{
key: 2,
text: 'Depart at',
value: 1,
},
{
key: 3,
text: 'Arrive at',
value: 2,
},
]}
selection
defaultValue={type}
style={{ marginLeft: '3px' }}
onChange={(e, data) => {
onChange('type', data.value)
}}
/>
<Input placeholder="Search..." style={{ marginLeft: '3px' }}>
<input
type="datetime-local"
value={value}
onChange={(e) => onChange('value', e.target.value)}
disabled={type < 0}
/>
</Input>
</div>
)
}

DateTimePicker.propTypes = {
type: PropTypes.number,
value: PropTypes.string,
onChange: PropTypes.func,
}

0 comments on commit 3d77efd

Please sign in to comment.