From 7e594beb5b884108cfafb7202801106554580527 Mon Sep 17 00:00:00 2001 From: Lucid Kobold Date: Sun, 5 Dec 2021 20:55:34 -0600 Subject: [PATCH] Form validation with emojis. --- components/calender/FormValidateEmoji.tsx | 35 +++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 components/calender/FormValidateEmoji.tsx diff --git a/components/calender/FormValidateEmoji.tsx b/components/calender/FormValidateEmoji.tsx new file mode 100644 index 0000000..4571d36 --- /dev/null +++ b/components/calender/FormValidateEmoji.tsx @@ -0,0 +1,35 @@ +import React, { FC } from "react"; + +interface EmojiValidateEmojiProps { + type: string; +} + +const EmojiValidateEmoji: FC = ({ + type, +}: EmojiValidateEmojiProps) => { + interface Validations { + [key: string]: JSX.Element; + } + + const validations: Validations = { + Required: ( + + ❗ + + ), + Error: ( + + ❌ + + ), + Valid: ( + + ✔ + + ), + }; + + return validations[`${type}`]; +}; + +export default EmojiValidateEmoji;