diff --git a/apps/marketing/src/components/(marketing)/footer.tsx b/apps/marketing/src/components/(marketing)/footer.tsx index b582dc286..1eb603165 100644 --- a/apps/marketing/src/components/(marketing)/footer.tsx +++ b/apps/marketing/src/components/(marketing)/footer.tsx @@ -3,7 +3,6 @@ import type { HTMLAttributes } from 'react'; import Image from 'next/image'; import Link from 'next/link'; -import { StatusWidget } from '@openstatus/react'; import { FaXTwitter } from 'react-icons/fa6'; import { LiaDiscord } from 'react-icons/lia'; import { LuGithub } from 'react-icons/lu'; @@ -12,6 +11,8 @@ import LogoImage from '@documenso/assets/logo.png'; import { cn } from '@documenso/ui/lib/utils'; import { ThemeSwitcher } from '@documenso/ui/primitives/theme-switcher'; +import { StatusWidget } from './status-widget'; + export type FooterProps = HTMLAttributes; const SOCIAL_LINKS = [ @@ -63,7 +64,7 @@ export const Footer = ({ className, ...props }: FooterProps) => {
- +
diff --git a/apps/marketing/src/components/(marketing)/status-widget.tsx b/apps/marketing/src/components/(marketing)/status-widget.tsx new file mode 100644 index 000000000..46851d1d0 --- /dev/null +++ b/apps/marketing/src/components/(marketing)/status-widget.tsx @@ -0,0 +1,73 @@ +import type { Status } from '@openstatus/react'; +import { getStatus } from '@openstatus/react'; + +import { cn } from '@documenso/ui/lib/utils'; + +const getStatusLevel = (level: Status) => { + return { + operational: { + label: 'Operational', + color: 'bg-green-500', + color2: 'bg-green-400', + }, + degraded_performance: { + label: 'Degraded Performance', + color: 'bg-yellow-500', + color2: 'bg-yellow-400', + }, + partial_outage: { + label: 'Partial Outage', + color: 'bg-yellow-500', + color2: 'bg-yellow-400', + }, + major_outage: { + label: 'Major Outage', + color: 'bg-red-500', + color2: 'bg-red-400', + }, + unknown: { + label: 'Unknown', + color: 'bg-gray-500', + color2: 'bg-gray-400', + }, + incident: { + label: 'Incident', + color: 'bg-yellow-500', + color2: 'bg-yellow-400', + }, + under_maintenance: { + label: 'Under Maintenance', + color: 'bg-gray-500', + color2: 'bg-gray-400', + }, + }[level]; +}; + +export async function StatusWidget() { + const { status } = await getStatus('documenso'); + + const level = getStatusLevel(status); + + return ( + +
+

{level.label}

+
+ + + + + +
+ ); +}