-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(nx-dev): use textarea for prompts and show a better "no results"…
…error (#18798)
- Loading branch information
Showing
5 changed files
with
143 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,52 @@ | ||
import { XCircleIcon } from '@heroicons/react/24/outline'; | ||
import { | ||
XCircleIcon, | ||
ExclamationTriangleIcon, | ||
} from '@heroicons/react/24/outline'; | ||
|
||
export function ErrorMessage({ error }: { error: any }): JSX.Element { | ||
return ( | ||
<div className="rounded-md bg-red-50 p-4"> | ||
<div className="flex"> | ||
<div className="flex-shrink-0"> | ||
<XCircleIcon className="h-5 w-5 text-red-400" aria-hidden="true" /> | ||
if (error.data.no_results) { | ||
return ( | ||
<div className="rounded-md bg-yellow-50 p-4"> | ||
<div className="flex"> | ||
<div className="flex-shrink-0"> | ||
<ExclamationTriangleIcon | ||
className="h-5 w-5 text-yellow-500" | ||
aria-hidden="true" | ||
/> | ||
</div> | ||
<div className="ml-3"> | ||
<h3 className="text-sm font-medium text-yellow-800"> | ||
No results found | ||
</h3> | ||
<div className="mt-2 text-sm text-yellow-700"> | ||
Sorry, I don't know how to help with that. You can visit the{' '} | ||
<a | ||
href="https://nx.dev/getting-started/intro" | ||
className="underline" | ||
> | ||
Nx documentation | ||
</a>{' '} | ||
for more info. | ||
</div> | ||
</div> | ||
</div> | ||
<div className="ml-3"> | ||
<h3 className="text-sm font-medium text-red-800"> | ||
Oopsies! I encountered an error | ||
</h3> | ||
<div className="mt-2 text-sm text-red-700">{error['message']}</div> | ||
</div> | ||
); | ||
} else { | ||
return ( | ||
<div className="rounded-md bg-red-50 p-4"> | ||
<div className="flex"> | ||
<div className="flex-shrink-0"> | ||
<XCircleIcon className="h-5 w-5 text-red-400" aria-hidden="true" /> | ||
</div> | ||
<div className="ml-3"> | ||
<h3 className="text-sm font-medium text-red-800"> | ||
Oopsies! I encountered an error | ||
</h3> | ||
<div className="mt-2 text-sm text-red-700">{error['message']}</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
e4755cb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
nx-dev – ./
nx-dev-nrwl.vercel.app
nx-five.vercel.app
nx-dev-git-master-nrwl.vercel.app
nx.dev