|
1
|
import React from "react" |
|
2
|
import { WarningNote } from "./Types/warning" |
|
3
|
import { DefaultNote } from "./Types/default" |
|
4
|
import { SuccessNote } from "./Types/sucess" |
|
5
|
import { ErrorNote } from "./Types/error" |
|
6
|
import { CheckNote } from "./Types/checks" |
|
7
|
import { SoonNote } from "./Types/soon" |
|
8
|
|
|
9
|
export type NoteProps = { |
|
10
|
type?: "default" | "warning" | "success" | "error" | "check" | "soon" |
|
11
|
title?: string |
|
12
|
children?: React.ReactNode |
|
13
|
forceMultiline?: boolean |
|
14
|
} |
|
15
|
|
|
16
|
export const Note = ({ type = "default", ...props }: NoteProps) => { |
|
17
|
switch (type) { |
|
18
|
case "warning": |
|
19
|
return <WarningNote type={type} {...props} /> |
|
20
|
case "success": |
|
21
|
return <SuccessNote type={type} {...props} /> |
|
22
|
case "error": |
|
23
|
return <ErrorNote type={type} {...props} /> |
|
24
|
// TODO remove both once we've removed all notes using them |
|
25
|
case "check": |
|
26
|
return <CheckNote type={type} {...props} /> |
|
27
|
case "soon": |
|
28
|
return <SoonNote type={type} {...props} /> |
|
29
|
default: |
|
30
|
return <DefaultNote type={type} {...props} /> |
|
31
|
} |
|
32
|
} |