summaryrefslogtreecommitdiffstats
path: root/src/components/Notice
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/Notice')
-rw-r--r--src/components/Notice/Notice.module.scss28
-rw-r--r--src/components/Notice/Notice.tsx20
2 files changed, 48 insertions, 0 deletions
diff --git a/src/components/Notice/Notice.module.scss b/src/components/Notice/Notice.module.scss
new file mode 100644
index 0000000..deae4e4
--- /dev/null
+++ b/src/components/Notice/Notice.module.scss
@@ -0,0 +1,28 @@
+@use "@styles/abstracts/functions" as fun;
+
+.message {
+ border: fun.convert-px(2) solid;
+ font-weight: bold;
+ margin: var(--spacing-sm) auto;
+ padding: var(--spacing-2xs) var(--spacing-xs);
+
+ &--error {
+ border-color: var(--color-error);
+ color: var(--color-error);
+ }
+
+ &--info {
+ border-color: var(--color-info);
+ color: var(--color-info);
+ }
+
+ &--success {
+ border-color: var(--color-success);
+ color: var(--color-success);
+ }
+
+ &--warning {
+ border-color: var(--color-warning);
+ color: var(--color-warning);
+ }
+}
diff --git a/src/components/Notice/Notice.tsx b/src/components/Notice/Notice.tsx
new file mode 100644
index 0000000..c941bf9
--- /dev/null
+++ b/src/components/Notice/Notice.tsx
@@ -0,0 +1,20 @@
+import { ReactNode } from 'react';
+import styles from './Notice.module.scss';
+
+type NoticeType = 'error' | 'info' | 'success' | 'warning';
+
+const Notice = ({
+ children,
+ type,
+}: {
+ children: ReactNode;
+ type: NoticeType;
+}) => {
+ return (
+ <div className={`${styles.message} ${styles[`message--${type}`]}`}>
+ {children}
+ </div>
+ );
+};
+
+export default Notice;