-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
- Loading branch information
Showing
5 changed files
with
156 additions
and
62 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,49 @@ | ||
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
Oops, something went wrong.