Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Results-Alert Component #194

Merged
merged 12 commits into from
Oct 16, 2021
Prev Previous commit
Next Next commit
added content to component
  • Loading branch information
azheng1991 committed Oct 15, 2021
commit a189cadc229e97051eb70e92735e5b571b2e233e
28 changes: 28 additions & 0 deletions frontend/shared-components/results-alert/results-alert.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from "react"
import styles from "./results-alert.module.css"
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
import { faExclamationTriangle } from "@fortawesome/free-solid-svg-icons"
import { alertContent, SearchResultsTypes } from "../../models"
import { PrimaryButton } from "../"

interface ResultsAlertProps {
type: SearchResultsTypes
returnHandler(): any
}

export default function ResultsAlert({ type, returnHandler }: ResultsAlertProps) {
const alertMessage = alertContent[type]
return (
<div className={styles.outerBox} role="alert">
<div className={styles.innerBox}>
<FontAwesomeIcon size="2x" icon={faExclamationTriangle} />
<div>
<span className={styles.alertMessage}>{alertMessage}</span>
<p>Please revise search or explore map</p>
</div>
</div>

<PrimaryButton onClick={returnHandler}>Return</PrimaryButton>
</div>
)
}