"use client"; import type { CSSProperties, MouseEvent as ReactMouseEvent } from "react"; import { Button, Group, Paper, SimpleGrid, Stack, Text, ThemeIcon, Title } from "@mantine/core"; import { IconArrowRight, IconBook2, IconSparkles, IconTool } from "@tabler/icons-react"; import confetti from "canvas-confetti"; import { createDocumentationLink } from "@homarr/definitions"; import { useScopedI18n } from "@homarr/translation/client"; import { Link } from "@homarr/ui"; import { OnboardingBackdrop } from "./onboarding-backdrop"; import { OnboardingWordmark } from "./onboarding-wordmark"; import type { OnboardingStudioProps } from "./types"; import { useOnboardingSounds } from "./use-onboarding-sounds"; import classes from "./onboarding-studio.module.css"; export const Finish = ({ environment }: OnboardingStudioProps) => { const t = useScopedI18n("init.studio.finish"); const sounds = useOnboardingSounds(); const primaryColor = environment.initialBoard?.primaryColor ?? "#fa5252"; const secondaryColor = environment.initialBoard?.secondaryColor ?? "#fd7e14"; const boardHref = `/boards/${encodeURIComponent(environment.initialBoard?.name ?? "dashboard")}`; const destination = environment.canConfigurePrivileged ? boardHref : `/auth/login?callbackUrl=${encodeURIComponent(boardHref)}`; const openBoard = (event: ReactMouseEvent) => { sounds.success(); if ( event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || window.matchMedia("(prefers-reduced-motion: reduce)").matches ) { return; } event.preventDefault(); const button = event.currentTarget.getBoundingClientRect(); void confetti({ particleCount: 120, spread: 75, startVelocity: 45, origin: { x: (button.left + button.width / 2) / window.innerWidth, y: (button.top + button.height / 2) / window.innerHeight, }, disableForReducedMotion: true, }); window.setTimeout(() => window.location.assign(destination), 450); }; return (
{t("title")} {t("description")}
); }; const NextCard = (props: { icon: typeof IconTool; title: string; description: string; href: string; external?: boolean; }) => (props.external ? : ); const InternalNextCard = ({ icon: Icon, title, description, href, }: { icon: typeof IconTool; title: string; description: string; href: string; }) => ( {title} {description} ); const ExternalNextCard = ({ icon: Icon, title, description, href }: Parameters[0]) => ( {title} {description} );