diff --git a/apps/web/app/(app)/[emailAccountId]/assistant/RulesPrompt.tsx b/apps/web/app/(app)/[emailAccountId]/assistant/RulesPrompt.tsx index 48210cf01..b12a8ce05 100644 --- a/apps/web/app/(app)/[emailAccountId]/assistant/RulesPrompt.tsx +++ b/apps/web/app/(app)/[emailAccountId]/assistant/RulesPrompt.tsx @@ -37,6 +37,7 @@ import { ScrollArea } from "@/components/ui/scroll-area"; import { cn } from "@/utils"; import { Notice } from "@/components/Notice"; import { getActionTypeColor } from "@/app/(app)/[emailAccountId]/assistant/constants"; +import { Skeleton } from "@/components/ui/skeleton"; export function RulesPrompt() { const { emailAccountId } = useAccount(); @@ -58,7 +59,11 @@ export function RulesPrompt() { return ( <> - + } + > {data && (
- } - /> -
*/} - - - - - -
- - Settings - Test - History - - {(await hasPendingRule) && ( - Pending - )} - - -
+
+
+
+ + +
+ Assistant + +
-
- - - - Learn how to use the AI Personal Assistant to automatically - label, archive, and more. - - } - videoId="SoeNDVr7ve4" - buttonProps={{ size: "sm", variant: "outline" }} - /> - - -
- - - - - - -
- -
-
- -
- + + +
+ + + + + + + + + + + + + + +
- - - {(await hasPendingRule) && ( - -
- -
-
- )} -
- +
+
); } + +async function TabNavigation({ + emailAccountId, + tab, + hasPendingRule, +}: { + emailAccountId: string; + tab: string; + hasPendingRule: Promise; +}) { + return ( + + ); +} + +async function PendingTab({ + hasPendingRule, +}: { + hasPendingRule: Promise; +}) { + const hasPendingRuleValue = await hasPendingRule; + + if (!hasPendingRuleValue) return null; + + return ( + + + + ); +} + +function ExtraActions({ emailAccountId }: { emailAccountId: string }) { + return ( +
+ + + + Learn how to use the AI Personal Assistant to automatically label, + archive, and more. + + } + videoId="SoeNDVr7ve4" + buttonProps={{ size: "sm", variant: "ghost" }} + /> + + +
+ ); +} diff --git a/apps/web/components/TabSelect.tsx b/apps/web/components/TabSelect.tsx new file mode 100644 index 000000000..bc85cd1f1 --- /dev/null +++ b/apps/web/components/TabSelect.tsx @@ -0,0 +1,101 @@ +"use client"; + +/* + * Adapted from: https://github.com/dubinc/dub + * + * Original work Copyright (c) 2023 Dub, Inc. + * Licensed under AGPL-3.0 + * + * This file may have been modified from the original. + */ +import { cn } from "@/utils"; +import { cva, type VariantProps } from "class-variance-authority"; +import { LayoutGroup, motion } from "framer-motion"; +import Link from "next/link"; +import { type Dispatch, type SetStateAction, useId } from "react"; +import { ArrowUpRight } from "lucide-react"; + +const tabSelectButtonVariants = cva("p-4 transition-colors duration-75", { + variants: { + variant: { + default: + "text-content-subtle data-[selected=true]:text-content-emphasis data-[selected=false]:hover:text-content-default", + accent: + "text-content-subtle transition-[color,font-weight] data-[selected=true]:text-blue-600 data-[selected=false]:hover:text-content-default data-[selected=true]:font-medium", + }, + }, + defaultVariants: { + variant: "default", + }, +}); + +const tabSelectIndicatorVariants = cva("absolute bottom-0 w-full px-1.5", { + variants: { + variant: { + default: "text-bg-inverted", + accent: "text-blue-600", + }, + }, + defaultVariants: { + variant: "default", + }, +}); + +export function TabSelect({ + variant, + options, + selected, + onSelect, + className, +}: VariantProps & { + options: { id: T; label: string; href?: string; target?: string }[]; + selected: string | null; + onSelect?: Dispatch> | ((id: T) => void); + className?: string; +}) { + const layoutGroupId = useId(); + + return ( +
+ + {options.map(({ id, label, href, target }) => { + const isSelected = id === selected; + const As = href ? Link : "div"; + return ( + + + {isSelected && ( + +
+ + )} + + ); + })} + +
+ ); +} diff --git a/apps/web/components/TopBar.tsx b/apps/web/components/TopBar.tsx index 2ef07fb4d..44fae7624 100644 --- a/apps/web/components/TopBar.tsx +++ b/apps/web/components/TopBar.tsx @@ -10,7 +10,7 @@ export function TopBar({ children, className, sticky = false }: TopBarProps) { return (
+
{trigger}
diff --git a/version.txt b/version.txt index 4e0d75544..d72a3cbc1 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -v1.8.6 +v1.8.7