From b3a9a4307a4723116dc33ce46e71528e76fd79ee Mon Sep 17 00:00:00 2001 From: BFlat Date: Thu, 10 Aug 2023 10:32:00 +0700 Subject: [PATCH] input field update rest syntax --- .../src/components/common/Input/Input.tsx | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 packages/fakeyou.com/src/components/common/Input/Input.tsx diff --git a/packages/fakeyou.com/src/components/common/Input/Input.tsx b/packages/fakeyou.com/src/components/common/Input/Input.tsx new file mode 100644 index 0000000000..547ce817ba --- /dev/null +++ b/packages/fakeyou.com/src/components/common/Input/Input.tsx @@ -0,0 +1,23 @@ +import React from "react"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import { IconDefinition } from "@fortawesome/fontawesome-svg-core"; + +interface InputProps extends React.InputHTMLAttributes { + icon?: IconDefinition; + label?: string; +} + +export default function Input({ label, icon, ...rest }: InputProps) { + return ( +
+ {label && } + +
+ {icon && ( + + )} + +
+
+ ); +}