Form validation with emojis.
This commit is contained in:
35
components/calender/FormValidateEmoji.tsx
Normal file
35
components/calender/FormValidateEmoji.tsx
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
import React, { FC } from "react";
|
||||||
|
|
||||||
|
interface EmojiValidateEmojiProps {
|
||||||
|
type: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const EmojiValidateEmoji: FC<EmojiValidateEmojiProps> = ({
|
||||||
|
type,
|
||||||
|
}: EmojiValidateEmojiProps) => {
|
||||||
|
interface Validations {
|
||||||
|
[key: string]: JSX.Element;
|
||||||
|
}
|
||||||
|
|
||||||
|
const validations: Validations = {
|
||||||
|
Required: (
|
||||||
|
<span role="img" aria-label="Explication Mark">
|
||||||
|
❗
|
||||||
|
</span>
|
||||||
|
),
|
||||||
|
Error: (
|
||||||
|
<span role="img" aria-label="X">
|
||||||
|
❌
|
||||||
|
</span>
|
||||||
|
),
|
||||||
|
Valid: (
|
||||||
|
<span role="img" aria-label="Check">
|
||||||
|
✔
|
||||||
|
</span>
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
return validations[`${type}`];
|
||||||
|
};
|
||||||
|
|
||||||
|
export default EmojiValidateEmoji;
|
||||||
Reference in New Issue
Block a user