2022-11-18 02:39:52 -05:00
|
|
|
import { ChangeEvent, memo } from "react"
|
2022-03-21 23:30:45 -04:00
|
|
|
|
2022-11-16 03:49:12 -05:00
|
|
|
import Input from "@components/input"
|
2022-11-18 01:36:53 -05:00
|
|
|
import styles from "./title.module.css"
|
2022-03-06 19:46:59 -05:00
|
|
|
|
|
|
|
const titlePlaceholders = [
|
2022-04-09 20:48:19 -04:00
|
|
|
"How to...",
|
|
|
|
"Status update for ...",
|
|
|
|
"My new project",
|
|
|
|
"My new idea",
|
|
|
|
"Let's talk about...",
|
|
|
|
"What's up with ...",
|
|
|
|
"I'm thinking about ..."
|
2022-03-06 19:46:59 -05:00
|
|
|
]
|
|
|
|
|
2022-11-28 21:33:06 -05:00
|
|
|
const placeholder = titlePlaceholders[3]
|
|
|
|
|
2022-03-06 19:46:59 -05:00
|
|
|
type props = {
|
2022-04-09 20:48:19 -04:00
|
|
|
onChange: (e: ChangeEvent<HTMLInputElement>) => void
|
|
|
|
title?: string
|
2022-03-06 19:46:59 -05:00
|
|
|
}
|
|
|
|
|
2022-03-22 01:50:25 -04:00
|
|
|
const Title = ({ onChange, title }: props) => {
|
2022-04-09 20:48:19 -04:00
|
|
|
return (
|
|
|
|
<div className={styles.title}>
|
2022-12-04 17:26:05 -05:00
|
|
|
<h1 style={{ margin: 0, padding: 0 }}>Drift</h1>
|
2022-11-16 03:49:12 -05:00
|
|
|
<Input
|
|
|
|
placeholder={placeholder}
|
2022-11-20 22:26:07 -05:00
|
|
|
value={title}
|
2022-11-16 03:49:12 -05:00
|
|
|
onChange={onChange}
|
2022-11-18 01:36:53 -05:00
|
|
|
label="Title"
|
|
|
|
className={styles.labelAndInput}
|
|
|
|
style={{ width: "100%" }}
|
|
|
|
labelClassName={styles.labelAndInput}
|
2022-11-16 03:49:12 -05:00
|
|
|
/>
|
2022-04-09 20:48:19 -04:00
|
|
|
</div>
|
|
|
|
)
|
2022-03-06 19:46:59 -05:00
|
|
|
}
|
|
|
|
|
2022-11-18 02:39:52 -05:00
|
|
|
export default memo(Title)
|