Add beta to logged calls

This commit is contained in:
David Corbitt
2023-08-08 14:27:14 -07:00
parent 72e680e77c
commit ca33bb0b08
2 changed files with 16 additions and 8 deletions

View File

@@ -52,7 +52,7 @@ const NavSidebar = () => {
<>
<ProjectMenu />
<Divider />
<IconLink icon={IoStatsChartOutline} label="Logged Calls" href="/logged-calls" />
<IconLink icon={IoStatsChartOutline} label="Logged Calls" href="/logged-calls" beta/>
<IconLink icon={RiFlaskLine} label="Experiments" href="/experiments" />
{env.NEXT_PUBLIC_SHOW_DATA && (
<IconLink icon={RiDatabase2Line} label="Data" href="/data" />

View File

@@ -3,18 +3,26 @@ import Link, { type LinkProps } from "next/link";
import { type IconType } from "react-icons";
import NavSidebarOption from "./NavSidebarOption";
type IconLinkProps = BoxProps & LinkProps & { label?: string; icon: IconType; href: string };
type IconLinkProps = BoxProps &
LinkProps & { label?: string; icon: IconType; href: string; beta?: boolean };
const IconLink = ({ icon, label, href, color, ...props }: IconLinkProps) => {
const IconLink = ({ icon, label, href, color, beta, ...props }: IconLinkProps) => {
return (
<Link href={href} style={{ width: "100%" }}>
<NavSidebarOption activeHrefPattern={href}>
<HStack w="full" p={2} color={color} justifyContent="start" {...props}>
<HStack w="full" justifyContent="space-between" p={2} color={color} {...props}>
<HStack w="full" justifyContent="start">
<Icon as={icon} boxSize={6} mr={2} />
<Text fontSize="sm" display={{ base: "none", md: "block" }}>
{label}
</Text>
</HStack>
{beta && (
<Text fontSize="xs" ml={2} fontWeight="bold" color="orange.400">
BETA
</Text>
)}
</HStack>
</NavSidebarOption>
</Link>
);