Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

1.6 KB
Raw Blame
import type { ReactNode } from 'react';

import { Alert, Flex, Heading, Stack, Text } from '@chakra-ui/react';
import { InvokeMark } from '@platform/ui/InvokeMark';

/** Auth screens live outside workbench providers and rely only on semantic tokens. */
export const AuthScreen = ({
  children,
  footer,
  subtitle,
  title,
}: {
  children: ReactNode;
  footer?: ReactNode;
  subtitle: string;
  title: string;
}) => (
  // The dot grid colors its dots through `color`, so the content restores the foreground color.
  <Flex align="center" justify="center" layerStyle="dotGrid" minH="100dvh" p="6">
    <Stack color="fg" gap="6" maxW="sm" w="full">
      <Stack align="center" gap="4">
        <InvokeMark />
        <Stack align="center" gap="1">
          <Heading fontSize="2xl" fontWeight="700">
            {title}
          </Heading>
          <Text color="fg.muted" fontSize="lg" textAlign="center">
            {subtitle}
          </Text>
        </Stack>
      </Stack>
      <Stack bg="bg.subtle" borderColor="border.subtle" borderWidth="1px" gap="4" p="6" rounded="xl" shadow="lg">
        {children}
      </Stack>
      {footer ? (
        <Text color="fg.subtle" fontSize="md" textAlign="center">
          {footer}
        </Text>
      ) : null}
    </Stack>
  </Flex>
);

/** Inline alert used for form-level failures on the auth screens. */
export const AuthFormAlert = ({ message, tone }: { message: string; tone: 'error' | 'warning' }) => (
  <Alert.Root borderRadius="md" status={tone}>
    <Alert.Indicator />
    <Alert.Title fontSize="md">{message}</Alert.Title>
  </Alert.Root>
);