-
Notifications
You must be signed in to change notification settings - Fork 511
/
IndexPage.tsx
37 lines (33 loc) · 1018 Bytes
/
IndexPage.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { Snackbar, Starter } from "@fiftyone/core";
import React from "react";
import { usePreloadedQuery } from "react-relay";
import { graphql } from "relay-runtime";
import Nav from "../components/Nav";
import { Route } from "../routing";
import { IndexPageQuery } from "./__generated__/IndexPageQuery.graphql";
const IndexPageQueryNode = graphql`
query IndexPageQuery($search: String = "", $count: Int, $cursor: String) {
config {
colorBy
colorPool
colorscale
multicolorKeypoints
showSkeletons
}
allDatasets: estimatedDatasetCount
...NavFragment
...configFragment
}
`;
const IndexPage: Route<IndexPageQuery> = ({ prepared }) => {
const queryRef = usePreloadedQuery(IndexPageQueryNode, prepared);
const totalDatasets = queryRef.allDatasets;
return (
<>
<Nav fragment={queryRef} hasDataset={false} />
<Starter mode={totalDatasets === 0 ? "ADD_DATASET" : "SELECT_DATASET"} />
<Snackbar />
</>
);
};
export default IndexPage;