<script>import { Alert } from "./";
import { t } from "./intl";
export let error = "";
let message = "";
$: check = error.split(new RegExp(" *: *"))[0];
$: switch (check) {
  case "EMAIL_EXISTS":
  case "INVALID_EMAIL":
  case "WEAK_PASSWORD":
  case "INVALID_ARGUMENTS":
    message = $t(check) || error;
    break;
  default:
    message = $t(check) || error;
    break;
}
</script>

<Alert type="danger" description={message} />
