| 
									
										
										
										
											2021-09-06 13:51:15 +00:00
										 |  |  | import React from "react"; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-03-16 23:36:43 +00:00
										 |  |  | import { Alert, AlertProps } from "@calcom/ui/Alert"; | 
					
						
							| 
									
										
										
										
											2021-09-22 19:52:38 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-12 09:35:44 +00:00
										 |  |  | import { sandboxPage } from "."; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const page = sandboxPage(function AlertPage() { | 
					
						
							| 
									
										
										
										
											2021-09-06 13:51:15 +00:00
										 |  |  |   const list: AlertProps[] = [ | 
					
						
							|  |  |  |     { title: "Something went wrong", severity: "error" }, | 
					
						
							|  |  |  |     { title: "Something went kinda wrong", severity: "warning" }, | 
					
						
							|  |  |  |     { title: "Something went great", severity: "success" }, | 
					
						
							|  |  |  |     { title: "Something went wrong", severity: "error", message: "Some extra context" }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |       title: "Something went wrong", | 
					
						
							|  |  |  |       severity: "error", | 
					
						
							|  |  |  |       message: ( | 
					
						
							|  |  |  |         <p> | 
					
						
							|  |  |  |           Some extra context | 
					
						
							|  |  |  |           <br /> | 
					
						
							|  |  |  |           hey | 
					
						
							|  |  |  |         </p> | 
					
						
							|  |  |  |       ), | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |   ]; | 
					
						
							|  |  |  |   return ( | 
					
						
							|  |  |  |     <> | 
					
						
							| 
									
										
										
										
											2022-02-09 00:05:13 +00:00
										 |  |  |       <div className="bg-gray-200 p-4"> | 
					
						
							| 
									
										
										
										
											2021-09-06 13:51:15 +00:00
										 |  |  |         <h1>Alert component</h1> | 
					
						
							|  |  |  |         <div className="flex flex-col"> | 
					
						
							|  |  |  |           {list.map((props, index) => ( | 
					
						
							| 
									
										
										
										
											2022-02-09 00:05:13 +00:00
										 |  |  |             <div key={index} className="m-2 bg-white p-2"> | 
					
						
							| 
									
										
										
										
											2021-09-06 13:51:15 +00:00
										 |  |  |               <h3> | 
					
						
							|  |  |  |                 <code> | 
					
						
							|  |  |  |                   {JSON.stringify( | 
					
						
							|  |  |  |                     props, | 
					
						
							|  |  |  |                     (key, value) => { | 
					
						
							|  |  |  |                       if (key.includes("message")) { | 
					
						
							|  |  |  |                         return ".."; | 
					
						
							|  |  |  |                       } | 
					
						
							|  |  |  |                       return value; | 
					
						
							|  |  |  |                     }, | 
					
						
							|  |  |  |                     2 | 
					
						
							|  |  |  |                   )} | 
					
						
							|  |  |  |                 </code> | 
					
						
							|  |  |  |               </h3> | 
					
						
							|  |  |  |               <Alert {...props}>Alert text</Alert> | 
					
						
							|  |  |  |             </div> | 
					
						
							|  |  |  |           ))} | 
					
						
							|  |  |  |         </div> | 
					
						
							|  |  |  |       </div> | 
					
						
							|  |  |  |     </> | 
					
						
							|  |  |  |   ); | 
					
						
							| 
									
										
										
										
											2021-10-12 09:35:44 +00:00
										 |  |  | }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export default page.default; | 
					
						
							|  |  |  | export const getStaticProps = page.getStaticProps; |