import { Dispatch, SetStateAction } from "react"; import { Ico, Icon } from "components/Ico"; import { cJoin } from "helpers/className"; import { isDefinedAndNotEmpty } from "helpers/others"; /* * ╭─────────────╮ * ───────────────────────────────────────╯ COMPONENT ╰─────────────────────────────────────────── */ interface Props { state: string | undefined; setState: | Dispatch> | Dispatch>; className?: string; name?: string; placeholder?: string; } // ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ export const TextInput = ({ state, setState, className, name, placeholder, }: Props): JSX.Element => (
{ setState(event.target.value); }} /> {isDefinedAndNotEmpty(state) && (
{ setState(""); }} />
)}
);