mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
* feat: add API key management UI - Created settings page for users to create, view, and delete API keys - Added Settings link to app navigation header - Fixed delete operation return value handling in backend to properly handle asyncpg's None response * feat: replace browser confirm with dialog for API key deletion - Added Chakra UI Dialog component for better UX when confirming API key deletion - Implemented proper focus management with cancelRef for accessibility - Replaced native browser confirm() with controlled dialog state * style: format API keys page with consistent line breaks * feat: auto-select API key text for easier copying - Added automatic text selection after API key creation to streamline the copy workflow - Applied className to Code component for DOM targeting * feat: improve API keys page layout and responsiveness - Reduced max width from 1200px to 800px for better readability - Added explicit width constraint to ensure consistent sizing across viewports * refactor: remove redundant comments from API keys page
102 lines
2.5 KiB
TypeScript
102 lines
2.5 KiB
TypeScript
import { Container, Flex, Link } from "@chakra-ui/react";
|
|
import { featureEnabled } from "../lib/features";
|
|
import NextLink from "next/link";
|
|
import Image from "next/image";
|
|
import UserInfo from "../(auth)/userInfo";
|
|
import AuthWrapper from "./AuthWrapper";
|
|
import { RECORD_A_MEETING_URL } from "../api/urls";
|
|
|
|
export default async function AppLayout({
|
|
children,
|
|
}: {
|
|
children: React.ReactNode;
|
|
}) {
|
|
return (
|
|
<Container
|
|
minW="100vw"
|
|
maxH="100vh"
|
|
minH="100vh"
|
|
maxW="container.xl"
|
|
display="grid"
|
|
gridTemplateRows="auto minmax(0,1fr)"
|
|
>
|
|
<Flex
|
|
as="header"
|
|
justify="space-between"
|
|
alignItems="center"
|
|
w="100%"
|
|
py="2"
|
|
px="0"
|
|
mt="1"
|
|
>
|
|
{/* Logo on the left */}
|
|
<Link as={NextLink} href="/" className="flex">
|
|
<Image
|
|
src="/reach.svg"
|
|
width={32}
|
|
height={40}
|
|
className="h-11 w-auto"
|
|
alt="Reflector"
|
|
/>
|
|
<div className="hidden flex-col ml-3 md:block">
|
|
<h1 className="text-[28px] font-semibold leading-tight">
|
|
Reflector
|
|
</h1>
|
|
<p className="text-gray-500 text-xs tracking-tight -mt-1">
|
|
Capture the signal, not the noise
|
|
</p>
|
|
</div>
|
|
</Link>
|
|
<div>
|
|
{/* Text link on the right */}
|
|
<Link
|
|
as={NextLink}
|
|
href={RECORD_A_MEETING_URL}
|
|
className="font-light px-2"
|
|
>
|
|
Create
|
|
</Link>
|
|
{featureEnabled("browse") ? (
|
|
<>
|
|
·
|
|
<Link href="/browse" as={NextLink} className="font-light px-2">
|
|
Browse
|
|
</Link>
|
|
</>
|
|
) : (
|
|
<></>
|
|
)}
|
|
{featureEnabled("rooms") ? (
|
|
<>
|
|
·
|
|
<Link href="/rooms" as={NextLink} className="font-light px-2">
|
|
Rooms
|
|
</Link>
|
|
</>
|
|
) : (
|
|
<></>
|
|
)}
|
|
{featureEnabled("requireLogin") ? (
|
|
<>
|
|
·
|
|
<Link
|
|
href="/settings/api-keys"
|
|
as={NextLink}
|
|
className="font-light px-2"
|
|
>
|
|
Settings
|
|
</Link>
|
|
·
|
|
<UserInfo />
|
|
</>
|
|
) : (
|
|
<></>
|
|
)}
|
|
</div>
|
|
</Flex>
|
|
|
|
<AuthWrapper>{children}</AuthWrapper>
|
|
</Container>
|
|
);
|
|
}
|