Skip to content

Instantly share code, notes, and snippets.

@brigand
Created July 24, 2021 20:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brigand/2efcb437918f527c5f63bfb3f7457948 to your computer and use it in GitHub Desktop.
Save brigand/2efcb437918f527c5f63bfb3f7457948 to your computer and use it in GitHub Desktop.
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