Skip to content

Commit

Permalink
improve embeddings cta take 2
Browse files Browse the repository at this point in the history
  • Loading branch information
ritch committed Oct 29, 2024
1 parent ee792ee commit 9ef86c9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/packages/embeddings/src/ComputeVisualizationButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { usePanelId } from "@fiftyone/spaces";
import AddIcon from "@mui/icons-material/Add";
import { useTheme } from "@fiftyone/components";

export default function ComputeVisualizationButton() {
export default function ComputeVisualizationButton({ uri }) {
const triggerEvent = usePanelEvent();
const theme = useTheme();
const panelId = usePanelId();
Expand All @@ -19,7 +19,7 @@ export default function ComputeVisualizationButton() {
onClick={() => {
triggerEvent(panelId, {
params: { delegate: true },
operator: "@voxel51/brain/compute_visualization",
operator: uri,
prompt: true,
});
}}
Expand Down
12 changes: 6 additions & 6 deletions app/packages/embeddings/src/EmptyEmbeddings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const useFirstExistingUri = (uris: string[]) => {
export default function EmptyEmbeddings() {
const theme = useTheme();
const secondaryBodyColor = theme.text.secondary;
const { firstExistingUri: computeVisUri, exists: hasComputeVisualization } =
let { firstExistingUri: computeVisUri, exists: hasComputeVisualization } =
useFirstExistingUri([
"@voxel51/brain/compute_visualization",
"@voxel51/operators/compute_visualization",
Expand All @@ -33,7 +33,7 @@ export default function EmptyEmbeddings() {
display: "flex",
alignItems: "center",
justifyContent: "center",
backgroundColor: "#262626",
backgroundColor: theme.background.body,
margin: 2,
}}
>
Expand Down Expand Up @@ -68,14 +68,14 @@ export default function EmptyEmbeddings() {
</Grid>
<Grid item />
{!hasComputeVisualization && <OSSContent />}
{hasComputeVisualization && <TeamsContent />}
{hasComputeVisualization && <ComputeVisContent uri={computeVisUri} />}
</Grid>
</Box>
{hasComputeVisualization && (
<Box
sx={{
position: "absolute",
bottom: "100px",
bottom: "50px",
display: "flex",
flexDirection: "column",
alignItems: "center",
Expand Down Expand Up @@ -120,13 +120,13 @@ function OSSContent() {
);
}

function TeamsContent() {
function ComputeVisContent({ uri }) {
const theme = useTheme();
const secondaryBodyColor = theme.text.secondary;
return (
<>
<Grid item>
<ComputeVisualizationButton />
<ComputeVisualizationButton uri={uri} />
</Grid>
</>
);
Expand Down

0 comments on commit 9ef86c9

Please sign in to comment.