Skip to content

Instantly share code, notes, and snippets.

@brigand
Created Jul 24, 2021
Embed
What would you like to do?
import React, { useState } from "react";
import styled from "styled-components";
import { Button, Form } from 'semantic-ui-react'
const PatientDetails = () => {
const [details, setDetails] = useState({
name: "John Doe",
gender: "male",
age: 34,
referredBy: "self",
});
const { name, gender, age, referredBy } = details;
const genderOptions = [
{ key: 'm', text: 'Male', value: 'male' },
{ key: 'f', text: 'Female', value: 'female' },
{ key: 'o', text: 'Other', value: 'other' },
]
return <fieldset>
<legend>
<h1>Patient Details</h1>
</legend>
<Form.Input
fluid
label='Name'
placeholder='Enter name'
value={name}
onChange={({ target }) => setDetails(current => ({ ...current, name: target.value }))}
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment