-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[OPIK-228] [UX improvements] Implement empty states on the project pa…
…ge (#427)
- Loading branch information
1 parent
4ae9200
commit 2b7cbef
Showing
3 changed files
with
67 additions
and
16 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 61 additions & 0 deletions
61
apps/opik-frontend/src/components/pages/TracesPage/NoTracesPage.tsx
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 |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import React from "react"; | ||
import { Book, GraduationCap } from "lucide-react"; | ||
import logFirstTraceImageUrl from "/images/log-first-trace.png"; | ||
import { Button } from "@/components/ui/button"; | ||
import { buildDocsUrl } from "@/lib/utils"; | ||
import { Link } from "@tanstack/react-router"; | ||
import useAppStore from "@/store/AppStore"; | ||
|
||
type NoTracesPageProps = { | ||
name: string; | ||
}; | ||
|
||
const NoTracesPage: React.FC<NoTracesPageProps> = ({ name }) => { | ||
const workspaceName = useAppStore((state) => state.activeWorkspaceName); | ||
|
||
return ( | ||
<div className="min-w-[340px] py-6"> | ||
<div className="pb-6"> | ||
<h1 | ||
data-testid="traces-page-title" | ||
className="comet-title-l truncate break-words" | ||
> | ||
{name} | ||
</h1> | ||
</div> | ||
<div className="flex flex-col items-center rounded-md border bg-white px-6 pb-6 pt-20"> | ||
<h2 className="comet-title-m">Log your first trace</h2> | ||
<div className="comet-body-s max-w-[570px] px-4 pb-8 pt-4 text-center text-muted-slate"> | ||
Logging traces helps you understand the flow of your application and | ||
identify specific points in your application that may be causing | ||
issues. | ||
</div> | ||
<img | ||
className="max-h-[400px] object-cover" | ||
src={logFirstTraceImageUrl} | ||
alt="image first trace" | ||
/> | ||
<div className="flex flex-wrap justify-center gap-2 pt-8"> | ||
<Button variant="secondary" asChild> | ||
<a | ||
href={buildDocsUrl("/tracing/log_traces")} | ||
target="_blank" | ||
rel="noreferrer" | ||
> | ||
<Book className="mr-2 size-4"></Book> | ||
Read documentation | ||
</a> | ||
</Button> | ||
<Link to="/$workspaceName/quickstart" params={{ workspaceName }}> | ||
<Button> | ||
<GraduationCap className="mr-2 size-4" /> | ||
Explore Quickstart guide | ||
</Button> | ||
</Link> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default NoTracesPage; |
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