Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

add more client access checks

Steven Tey7592c9f41a9a
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/conversion-tracking-section.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/conversion-tracking-section.tsx
index eee12e1051..c5333ce15a 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/conversion-tracking-section.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/conversion-tracking-section.tsx
@@ -1,5 +1,6 @@
"use client";
+import { clientAccessCheck } from "@/lib/client-access-check";
import useWorkspace from "@/lib/swr/use-workspace";
import { useWorkspaceStore } from "@/lib/swr/use-workspace-store";
import { LockSmall, Switch } from "@dub/ui";
@@ -10,7 +11,13 @@ import { PublishableKeyForm } from "./publishable-key-form";
export function ConversionTrackingSection() {
const id = useId();
- const { publishableKey } = useWorkspace();
+ const { role, publishableKey } = useWorkspace();
+
+ const permissionsError = clientAccessCheck({
+ action: "workspaces.write",
+ role,
+ customPermissionDescription: "manage conversion tracking settings",
+ }).error;
const [enabled, setEnabled, { loading }] = useWorkspaceStore<boolean>(
"analyticsSettingsConversionTrackingEnabled",
@@ -57,9 +64,10 @@ export function ConversionTrackingSection() {
thumbDimensions="size-3"
thumbTranslate="translate-x-3"
fn={setEnabled}
- {...(publishableKey
+ {...(publishableKey || permissionsError
? {
disabledTooltip:
+ permissionsError ||
"You need to revoke your current publishable key first before disabling conversion tracking.",
thumbIcon: (
<div className="flex size-full items-center justify-center">
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/conversion-tracking-toggle.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/conversion-tracking-toggle.tsx
index b03a66dc8e..e9b8355aa7 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/conversion-tracking-toggle.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/conversion-tracking-toggle.tsx
@@ -26,6 +26,8 @@ export function ConversionTrackingToggle() {
const permissionsError = clientAccessCheck({
action: "workspaces.write",
role,
+ customPermissionDescription:
+ "manage workspace-level conversion tracking settings",
}).error;
const [conversionEnabled, setConversionEnabled] = useState(
@@ -105,7 +107,8 @@ export function ConversionTrackingToggle() {
"transition-colors duration-100 ease-out",
conversionEnabled &&
"bg-bg-inverted text-content-inverted border-bg-inverted",
- !canTrackConversions && "cursor-not-allowed",
+ (!canTrackConversions || permissionsError) &&
+ "cursor-not-allowed opacity-50",
)}
>
<span className="text-sm font-medium">Conversion tracking</span>
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/hostname-section.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/hostname-section.tsx
index e5ff7ce15f..84647ba1ee 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/hostname-section.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/hostname-section.tsx
@@ -12,7 +12,13 @@ import HostnameMenu from "./hostname-menu";
export const HostnameSection = ({ className }: { className?: string }) => {
const { AddHostnameModal, setShowAddHostnameModal } = useAddHostnameModal();
- const { allowedHostnames, loading } = useWorkspace();
+ const { role, allowedHostnames, loading } = useWorkspace();
+
+ const permissionsError = clientAccessCheck({
+ action: "workspaces.write",
+ role,
+ customPermissionDescription: "manage allowed hostnames",
+ }).error;
let content;
@@ -51,6 +57,7 @@ export const HostnameSection = ({ className }: { className?: string }) => {
text="Add hostname"
className="h-7 w-fit rounded-lg px-2.5 py-1 text-sm font-medium"
onClick={() => setShowAddHostnameModal(true)}
+ disabledTooltip={permissionsError || undefined}
/>
</div>
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/outbound-domain-tracking-section.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/outbound-domain-tracking-section.tsx
index ff9f8f613b..0b4dc9fbf5 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/outbound-domain-tracking-section.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/outbound-domain-tracking-section.tsx
@@ -1,11 +1,14 @@
"use client";
+import { clientAccessCheck } from "@/lib/client-access-check";
+import useWorkspace from "@/lib/swr/use-workspace";
import { useWorkspaceStore } from "@/lib/swr/use-workspace-store";
-import { Switch } from "@dub/ui";
+import { LockSmall, Switch } from "@dub/ui";
import { useId } from "react";
export function OutboundDomainTrackingSection() {
const id = useId();
+ const { role } = useWorkspace();
const [enabled, setEnabled, { loading }] = useWorkspaceStore<boolean>(
"analyticsSettingsOutboundDomainTrackingEnabled",
@@ -14,6 +17,12 @@ export function OutboundDomainTrackingSection() {
},
);
+ const permissionsError = clientAccessCheck({
+ action: "workspaces.write",
+ role,
+ customPermissionDescription: "manage outbound domain tracking",
+ }).error;
+
return (
<div className="flex flex-1 flex-col rounded-lg border border-neutral-200 bg-neutral-50">
<div className="flex items-center justify-between gap-4 p-3">
@@ -41,6 +50,16 @@ export function OutboundDomainTrackingSection() {
<Switch
disabled={loading}
+ {...(permissionsError
+ ? {
+ disabledTooltip: permissionsError,
+ thumbIcon: (
+ <div className="flex size-full items-center justify-center">
+ <LockSmall className="size-[8px] text-black" />
+ </div>
+ ),
+ }
+ : {})}
checked={enabled || false}
trackDimensions="radix-state-checked:bg-black focus-visible:ring-black/20 w-7 h-4"
thumbDimensions="size-3"
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/site-visit-tracking-section.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/site-visit-tracking-section.tsx
index 908eb76c12..868f99ca77 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/site-visit-tracking-section.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/analytics/site-visit-tracking-section.tsx
@@ -1,7 +1,9 @@
"use client";
+import { clientAccessCheck } from "@/lib/client-access-check";
+import useWorkspace from "@/lib/swr/use-workspace";
import { useWorkspaceStore } from "@/lib/swr/use-workspace-store";
-import { Button, InfoTooltip, Sitemap, Switch } from "@dub/ui";
+import { Button, InfoTooltip, LockSmall, Sitemap, Switch } from "@dub/ui";
import { formatDate } from "@dub/utils";
import { motion } from "motion/react";
import { useId } from "react";
@@ -9,6 +11,7 @@ import { toast } from "sonner";
export function SiteVisitTrackingSection() {
const id = useId();
+ const { role } = useWorkspace();
const [enabled, setEnabled, { loading }] = useWorkspaceStore<boolean>(
"analyticsSettingsSiteVisitTrackingEnabled",
@@ -17,6 +20,12 @@ export function SiteVisitTrackingSection() {
},
);
+ const permissionsError = clientAccessCheck({
+ action: "workspaces.write",
+ role,
+ customPermissionDescription: "manage site visit tracking",
+ }).error;
+
const sitemaps = [
{
url: "dub.co/sitemap.xml",
@@ -43,6 +52,16 @@ export function SiteVisitTrackingSection() {
<Switch
disabled={loading}
+ {...(permissionsError
+ ? {
+ disabledTooltip: permissionsError,
+ thumbIcon: (
+ <div className="flex size-full items-center justify-center">
+ <LockSmall className="size-[8px] text-black" />
+ </div>
+ ),
+ }
+ : {})}
checked={enabled || false}
trackDimensions="radix-state-checked:bg-black focus-visible:ring-black/20 w-7 h-4"
thumbDimensions="size-3"
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/billing/payment-methods.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/billing/payment-methods.tsx
index 0e1952a6b5..1547978d06 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/billing/payment-methods.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/billing/payment-methods.tsx
@@ -65,8 +65,7 @@ export default function PaymentMethods() {
clientAccessCheck({
action: "billing.write",
role,
- customPermissionDescription: "manage payment methods",
- }).error || undefined
+ }).error
}
/>
)}
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/members/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/members/page-client.tsx
index 8b30263fa9..dc6bfb636b 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/members/page-client.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/members/page-client.tsx
@@ -44,7 +44,7 @@ import { useSearchParams } from "next/navigation";
import { useEffect, useMemo, useState } from "react";
import useSWR from "swr";
-export default function WorkspacePeopleClient() {
+export function WorkspaceMembersClient() {
const { setShowInviteWorkspaceUserModal, InviteWorkspaceUserModal } =
useInviteWorkspaceUserModal({ showSavedInvites: true });
@@ -245,36 +245,34 @@ export default function WorkspacePeopleClient() {
<PageContent
title="Members"
controls={
- isCurrentUserOwner && (
- <div className="flex space-x-2">
- <Button
- text="Invite member"
- onClick={() => setShowInviteWorkspaceUserModal(true)}
- className="h-9 w-fit"
- shortcut="M"
- disabledTooltip={
- clientAccessCheck({
- action: "workspaces.write",
- role,
- customPermissionDescription: "invite new teammates",
- }).error || undefined
- }
- />
- <Button
- icon={<LinkIcon className="h-4 w-4 text-neutral-800" />}
- variant="secondary"
- onClick={() => setShowInviteCodeModal(true)}
- className="h-9 space-x-0"
- disabledTooltip={
- clientAccessCheck({
- action: "workspaces.write",
- role,
- customPermissionDescription: "generate invite links",
- }).error || undefined
- }
- />
- </div>
- )
+ <div className="flex space-x-2">
+ <Button
+ text="Invite member"
+ onClick={() => setShowInviteWorkspaceUserModal(true)}
+ className="h-9 w-fit"
+ shortcut="M"
+ disabledTooltip={
+ clientAccessCheck({
+ action: "workspaces.write",
+ role,
+ customPermissionDescription: "invite new teammates",
+ }).error || undefined
+ }
+ />
+ <Button
+ icon={<LinkIcon className="h-4 w-4 text-neutral-800" />}
+ variant="secondary"
+ onClick={() => setShowInviteCodeModal(true)}
+ className="h-9 space-x-0"
+ disabledTooltip={
+ clientAccessCheck({
+ action: "workspaces.write",
+ role,
+ customPermissionDescription: "generate invite links",
+ }).error || undefined
+ }
+ />
+ </div>
}
>
<PageWidthWrapper className="mb-20 flex flex-col gap-4">
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/members/page.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/members/page.tsx
index 560589bf1f..65bf610ccc 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/members/page.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/members/page.tsx
@@ -1,5 +1,5 @@
-import WorkspacePeopleClient from "./page-client";
+import { WorkspaceMembersClient } from "./page-client";
-export default function WorkspacePeople() {
- return <WorkspacePeopleClient />;
+export default function WorkspaceMembers() {
+ return <WorkspaceMembersClient />;
}
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/security/saml.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/security/saml.tsx
index 90424166a8..067c418791 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/security/saml.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/security/saml.tsx
@@ -1,5 +1,6 @@
"use client";
+import { clientAccessCheck } from "@/lib/client-access-check";
import useSAML from "@/lib/swr/use-saml";
import useWorkspace from "@/lib/swr/use-workspace";
import { useRemoveSAMLModal } from "@/ui/modals/remove-saml-modal";
@@ -20,12 +21,18 @@ import { Lock, ShieldOff } from "lucide-react";
import { useMemo, useState } from "react";
export function SAML() {
- const { id: workspaceId, plan, ssoEmailDomain } = useWorkspace();
+ const { id: workspaceId, plan, role, ssoEmailDomain } = useWorkspace();
const { SAMLModal, setShowSAMLModal } = useSAMLModal();
const { RemoveSAMLModal, setShowRemoveSAMLModal } = useRemoveSAMLModal();
const { provider, configured, loading } = useSAML();
const [openPopover, setOpenPopover] = useState(false);
+ const permissionsError = clientAccessCheck({
+ action: "workspaces.write",
+ role,
+ customPermissionDescription: "configure SAML SSO",
+ }).error;
+
const {
data: workspaceData,
isLoading,
@@ -183,18 +190,19 @@ export function SAML() {
) : (
<Button
text="Configure"
- disabled={plan !== "enterprise"}
- {...(plan !== "enterprise" && {
- disabledTooltip: (
+ onClick={() => setShowSAMLModal(true)}
+ disabledTooltip={
+ plan !== "enterprise" ? (
<TooltipContent
title="SAML SSO is only available on Enterprise plans. Upgrade to get started."
cta="Contact sales"
href="https://dub.co/enterprise"
target="_blank"
/>
- ),
- })}
- onClick={() => setShowSAMLModal(true)}
+ ) : (
+ permissionsError || undefined
+ )
+ }
/>
)}
</div>
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/security/scim.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/security/scim.tsx
index 8b14dbd148..e99dae4a8b 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/security/scim.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/security/scim.tsx
@@ -1,5 +1,6 @@
"use client";
+import { clientAccessCheck } from "@/lib/client-access-check";
import useSCIM from "@/lib/swr/use-scim";
import useWorkspace from "@/lib/swr/use-workspace";
import { useRemoveSCIMModal } from "@/ui/modals/remove-scim-modal";
@@ -11,12 +12,18 @@ import { FolderSync, ShieldOff } from "lucide-react";
import { useMemo, useState } from "react";
export function SCIM() {
- const { plan } = useWorkspace();
+ const { plan, role } = useWorkspace();
const { SCIMModal, setShowSCIMModal } = useSCIMModal();
const { RemoveSCIMModal, setShowRemoveSCIMModal } = useRemoveSCIMModal();
const { provider, configured, loading } = useSCIM();
+ const permissionsError = clientAccessCheck({
+ action: "workspaces.write",
+ role,
+ customPermissionDescription: "configure SCIM Directory Sync",
+ }).error;
+
const data = useMemo(() => {
if (loading) {
return {
@@ -139,17 +146,18 @@ export function SCIM() {
) : (
<Button
text="Configure"
- disabled={plan !== "enterprise"}
- {...(plan !== "enterprise" && {
- disabledTooltip: (
+ disabledTooltip={
+ plan !== "enterprise" ? (
<TooltipContent
title="SCIM Directory Sync is only available on Enterprise plans. Upgrade to get started."
cta="Contact sales"
href="https://dub.co/enterprise"
target="_blank"
/>
- ),
- })}
+ ) : (
+ permissionsError || undefined
+ )
+ }
onClick={() => setShowSCIMModal(true)}
/>
)}
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/links/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/links/page-client.tsx
index 7e1782ec1c..51f7e43c81 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/links/page-client.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/links/page-client.tsx
@@ -423,7 +423,7 @@ function ImportOption({
<Tooltip
content={
<TooltipContent
- title="Your workspace has exceeded its monthly links limit. We're still collecting data on your existing links, but you need to upgrade to add more links."
+ title="Your workspace has exceeded its monthly links limit. We're still collecting data on your existing links, but you need to upgrade to create more links."
cta={nextPlan ? `Upgrade to ${nextPlan.name}` : "Contact support"}
href={`/${slug}/upgrade`}
/>
diff --git a/apps/web/lib/api/rbac/permissions.ts b/apps/web/lib/api/rbac/permissions.ts
index 644fdc18a0..a99908fa77 100644
--- a/apps/web/lib/api/rbac/permissions.ts
+++ b/apps/web/lib/api/rbac/permissions.ts
@@ -20,11 +20,11 @@ export const PERMISSION_ACTIONS = [
"webhooks.write",
"folders.read",
"folders.write",
- "payouts.write",
"groups.write",
"groups.read",
"messages.read",
"messages.write",
+ "payouts.write",
"billing.write",
] as const;
@@ -137,7 +137,7 @@ export const ROLE_PERMISSIONS: {
},
{
action: "billing.write",
- description: "create, update, or delete payment methods",
+ description: "manage billing details",
roles: ["owner", "billing"],
},
{
diff --git a/apps/web/ui/links/link-builder/link-action-bar.tsx b/apps/web/ui/links/link-builder/link-action-bar.tsx
index 073f5ff372..fa119e981a 100644
--- a/apps/web/ui/links/link-builder/link-action-bar.tsx
+++ b/apps/web/ui/links/link-builder/link-action-bar.tsx
@@ -1,3 +1,5 @@
+import { clientAccessCheck } from "@/lib/client-access-check";
+import useWorkspace from "@/lib/swr/use-workspace";
import { Button } from "@dub/ui";
import { cn } from "@dub/utils";
import { PropsWithChildren } from "react";
@@ -5,6 +7,12 @@ import { useFormContext, useFormState } from "react-hook-form";
import { LinkFormData } from "./link-builder-provider";
export function LinkActionBar({ children }: PropsWithChildren) {
+ const { role } = useWorkspace();
+ const permissionsError = clientAccessCheck({
+ action: "links.write",
+ role,
+ }).error;
+
const { control, reset } = useFormContext<LinkFormData>();
const { isDirty, isSubmitting, isSubmitSuccessful } = useFormState({
control,
@@ -41,6 +49,7 @@ export function LinkActionBar({ children }: PropsWithChildren) {
variant="secondary"
className="hidden h-7 px-2.5 text-xs lg:flex"
onClick={() => reset()}
+ disabledTooltip={permissionsError || undefined}
/>
<Button
type="submit"
@@ -48,6 +57,7 @@ export function LinkActionBar({ children }: PropsWithChildren) {
variant="primary"
className="h-7 px-2.5 text-xs"
loading={isSubmitting || isSubmitSuccessful}
+ disabledTooltip={permissionsError || undefined}
/>
</div>
</div>
diff --git a/apps/web/ui/modals/link-builder/index.tsx b/apps/web/ui/modals/link-builder/index.tsx
index e7d62c5a1c..923fb436e0 100644
--- a/apps/web/ui/modals/link-builder/index.tsx
+++ b/apps/web/ui/modals/link-builder/index.tsx
@@ -271,7 +271,7 @@ export function CreateLinkButton({
}).error;
useKeyboardShortcut("c", () => setShowLinkBuilder(true), {
- enabled: !permissionsError,
+ enabled: !exceededLinks && !permissionsError,
});
// listen to paste event, and if it's a URL, open the modal and input the URL
@@ -310,7 +310,7 @@ export function CreateLinkButton({
disabledTooltip={
exceededLinks ? (
<TooltipContent
- title="Your workspace has exceeded its monthly links limit. We're still collecting data on your existing links, but you need to upgrade to add more links."
+ title="Your workspace has exceeded its monthly links limit. We're still collecting data on your existing links, but you need to upgrade to create more links."
cta="Upgrade plan"
href={`/${slug}/upgrade`}
/>
diff --git a/apps/web/ui/workspaces/subscription-menu.tsx b/apps/web/ui/workspaces/subscription-menu.tsx
index 07971377b6..b6a25c9eb6 100644
--- a/apps/web/ui/workspaces/subscription-menu.tsx
+++ b/apps/web/ui/workspaces/subscription-menu.tsx
@@ -1,8 +1,10 @@
"use client";
+import { clientAccessCheck } from "@/lib/client-access-check";
import useWorkspace from "@/lib/swr/use-workspace";
import {
Button,
+ DynamicTooltipWrapper,
Icon,
LoadingSpinner,
Popover,
@@ -17,9 +19,14 @@ import { toast } from "sonner";
import { ThreeDots } from "../shared/icons";
export default function SubscriptionMenu() {
- const { id: workspaceId } = useWorkspace();
+ const { id: workspaceId, role } = useWorkspace();
const router = useRouter();
+ const permissionsError = clientAccessCheck({
+ action: "billing.write",
+ role,
+ }).error;
+
const [isOpen, setIsOpen] = useState(false);
const [clicked, setClicked] = useState(false);
@@ -54,11 +61,13 @@ export default function SubscriptionMenu() {
icon={StripeIcon}
label="Open billing portal"
onSelect={() => openBillingPortal(false)}
+ disabledTooltip={permissionsError}
/>
<MenuItem
icon={SquareXmark}
label="Cancel subscription"
onSelect={() => openBillingPortal(true)}
+ disabledTooltip={permissionsError}
/>
</Command.List>
</Command>
@@ -86,25 +95,28 @@ function MenuItem({
icon: IconComp,
label,
onSelect,
- disabled,
+ disabledTooltip,
}: {
icon: Icon;
label: string;
onSelect: () => void;
- disabled?: boolean;
+ disabledTooltip?: string | boolean;
}) {
return (
- <Command.Item
- className={cn(
- "flex cursor-pointer select-none items-center gap-2 whitespace-nowrap rounded-md p-2 text-sm text-neutral-600",
- "data-[selected=true]:bg-neutral-100",
- disabled && "cursor-not-allowed opacity-50",
- )}
- onSelect={onSelect}
- disabled={disabled}
+ <DynamicTooltipWrapper
+ tooltipProps={disabledTooltip ? { content: disabledTooltip } : undefined}
>
- <IconComp className="size-4 shrink-0 text-neutral-700" />
- {label}
- </Command.Item>
+ <Command.Item
+ className={cn(
+ "flex cursor-pointer select-none items-center gap-2 whitespace-nowrap rounded-md p-2 text-sm text-neutral-600",
+ "data-[selected=true]:bg-neutral-100",
+ disabledTooltip && "cursor-not-allowed opacity-50",
+ )}
+ onSelect={disabledTooltip ? undefined : onSelect}
+ >
+ <IconComp className="size-4 shrink-0 text-neutral-700" />
+ {label}
+ </Command.Item>
+ </DynamicTooltipWrapper>
);
}
diff --git a/packages/email/src/templates/links-limit.tsx b/packages/email/src/templates/links-limit.tsx
index 8f9e6633a9..e45edf089b 100644
--- a/packages/email/src/templates/links-limit.tsx
+++ b/packages/email/src/templates/links-limit.tsx
@@ -88,7 +88,7 @@ export default function LinksLimitAlert({
>
upgrade to a higher plan
</Link>{" "}
- to add more links.
+ to create more links.
</Text>
) : (
<Text className="text-sm leading-6 text-black">
@@ -99,7 +99,7 @@ export default function LinksLimitAlert({
>
upgrade to a higher plan
</Link>{" "}
- to add more links.
+ to create more links.
</Text>
)}
<Section className="mb-8">