Explorer V2 (#5548)

* remove pnpm lock file (should only be using yarn)

* Add lefthook configuration for pre-commit checks

* Add explorer-v2 to package.json dependencies

* add explorer v2

* update explorer v2 package name

* + basepath
+ redirect to basepath
+ blog icons refactor
+ icons refactor

* Add Getting Started instructions to README

* fix noise graph bug and line graph UI

* Delete unused translations, clean up console logs

* / test image url

* update yarn.lock

---------

Co-authored-by: RadekSabacky <radek@nymtech.net>
Co-authored-by: windy-ux <75579979+windy-ux@users.noreply.github.com>
Co-authored-by: Yana <iana.matrosova@gmail.com>
Co-authored-by: Mark Sinclair <mmsinclair@users.noreply.github.com>
This commit is contained in:
Fouad
2025-03-13 11:31:59 +00:00
committed by GitHub
parent 79ce611d21
commit dc88650d6d
219 changed files with 62763 additions and 5362 deletions
@@ -0,0 +1,60 @@
"use client";
import { Button, ButtonGroup, CircularProgress } from "@mui/material";
import { useState } from "react";
import { Link } from "../muiLink";
type Option = {
label: string;
isSelected: boolean;
link: string;
};
type Options = [Option, Option];
const ExplorerButtonGroup = ({
size = "small",
options,
onPage,
}: {
size?: "small" | "medium" | "large";
options: Options;
onPage: string;
}) => {
const [loading, setLoading] = useState<string | null>(null);
const handleClick = (label: string) => {
if (onPage === label) return;
setLoading(label);
};
return (
<ButtonGroup size={size}>
{options.map((option) => (
<Link
href={option.link}
key={option.label}
sx={{ textDecoration: "none" }}
onClick={() => handleClick(option.label)}
>
<Button
sx={{
color: option.isSelected
? "primary.contrastText"
: "text.primary",
"&:hover": {
bgcolor: option.isSelected ? "primary.main" : "",
},
bgcolor: option.isSelected ? "primary.main" : "transparent",
}}
variant="outlined"
>
{loading === option.label ? (
<CircularProgress size={18} color="inherit" />
) : (
option.label
)}
</Button>
</Link>
))}
</ButtonGroup>
);
};
export default ExplorerButtonGroup;