Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
File size: 3,890 Bytes
ebdfd67 2a8ebbd ebdfd67 2a8ebbd 83106dd ebdfd67 83106dd 2a8ebbd ebdfd67 2a8ebbd ebdfd67 2a8ebbd ebdfd67 2a8ebbd ebdfd67 a8a8975 ebdfd67 83106dd ebdfd67 |
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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
import React from "react";
import { Box, Typography, IconButton, Tooltip } from "@mui/material";
import OpenInNewIcon from "@mui/icons-material/OpenInNew";
import ShareIcon from "@mui/icons-material/Share";
import DarkModeOutlinedIcon from "@mui/icons-material/DarkModeOutlined";
import LightModeOutlinedIcon from "@mui/icons-material/LightModeOutlined";
import { useThemeMode } from "../hooks/useThemeMode";
const ExternalLinks = () => {
const { mode, toggleTheme } = useThemeMode();
const handleShare = async () => {
try {
await navigator.share({
title: "YourBench Demo",
text: "Check out this benchmark evaluation on YourBench!",
url: window.location.href,
});
} catch (err) {
console.log("Error sharing:", err);
}
};
return (
<Box
sx={{
position: "fixed",
top: 24,
left: 24,
right: 24,
margin: "auto",
display: "flex",
justifyContent: "space-between",
alignItems: "center",
zIndex: 1000,
}}
>
<Typography
variant="body2"
sx={{
display: "flex",
gap: 2,
alignItems: "center",
}}
>
<a
href="https://github.com/huggingface/yourbench"
target="_blank"
rel="noopener noreferrer"
style={{ textDecoration: "none", color: "inherit" }}
>
GitHub
<OpenInNewIcon sx={{ fontSize: "0.75rem", ml: 0.5, opacity: 0.6 }} />
</a>
<Typography component="span" sx={{ opacity: 0.5 }}>
•
</Typography>
<a
href="https://huggingface.co/datasets/sumuks/tempora"
target="_blank"
rel="noopener noreferrer"
style={{ textDecoration: "none", color: "inherit" }}
>
Dataset
<OpenInNewIcon sx={{ fontSize: "0.75rem", ml: 0.5, opacity: 0.6 }} />
</a>
<Typography component="span" sx={{ opacity: 0.5 }}>
•
</Typography>
<a
href="https://github.com/huggingface/yourbench/tree/main/docs"
target="_blank"
rel="noopener noreferrer"
style={{ textDecoration: "none", color: "inherit" }}
>
Documentation
<OpenInNewIcon sx={{ fontSize: "0.75rem", ml: 0.5, opacity: 0.6 }} />
</a>
<Typography component="span" sx={{ opacity: 0.5 }}>
•
</Typography>
<a
href="https://huggingface.co/spaces/yourbench/yourbench-demo"
target="_blank"
rel="noopener noreferrer"
style={{ textDecoration: "none", color: "inherit" }}
>
Full demo
<OpenInNewIcon sx={{ fontSize: "0.75rem", ml: 0.5, opacity: 0.6 }} />
</a>
</Typography>
<Box sx={{ display: "flex", alignItems: "center" }}>
<Tooltip title="Share">
<IconButton
onClick={handleShare}
size="small"
sx={{
color: "inherit",
opacity: 0.7,
"&:hover": {
opacity: 1,
},
}}
>
<ShareIcon fontSize="small" />
</IconButton>
</Tooltip>
<Tooltip title={mode === "light" ? "Mode sombre" : "Mode clair"}>
<IconButton
onClick={toggleTheme}
size="small"
sx={{
ml: 1,
color: "inherit",
opacity: 0.7,
"&:hover": {
opacity: 1,
},
}}
>
{mode === "light" ? (
<DarkModeOutlinedIcon fontSize="small" />
) : (
<LightModeOutlinedIcon fontSize="small" />
)}
</IconButton>
</Tooltip>
</Box>
</Box>
);
};
export default ExternalLinks;
|