Yearly
@@ -256,18 +256,18 @@ function PricingTier({
}
};
- const tierPriceId = billingPeriod === 'yearly' && tier.yearlyStripePriceId
- ? tier.yearlyStripePriceId
+ const tierPriceId = billingPeriod === 'yearly' && tier.yearlyStripePriceId
+ ? tier.yearlyStripePriceId
: tier.stripePriceId;
- const displayPrice = billingPeriod === 'yearly' && tier.yearlyPrice
- ? tier.yearlyPrice
+ const displayPrice = billingPeriod === 'yearly' && tier.yearlyPrice
+ ? tier.yearlyPrice
: tier.price;
-
+
// Find the current tier (moved outside conditional for JSX access)
const currentTier = siteConfig.cloudPricingItems.find(
(p) => p.stripePriceId === currentSubscription?.price_id || p.yearlyStripePriceId === currentSubscription?.price_id,
);
-
+
const isCurrentActivePlan =
isAuthenticated && currentSubscription?.price_id === tierPriceId;
const isScheduled = isAuthenticated && currentSubscription?.has_schedule;
@@ -337,7 +337,7 @@ function PricingTier({
const currentIsYearly = currentTier && currentSubscription?.price_id === currentTier.yearlyStripePriceId;
const targetIsMonthly = tier.stripePriceId === tierPriceId;
const targetIsYearly = tier.yearlyStripePriceId === tierPriceId;
- const isSameTierDifferentBilling = currentTier && currentTier.name === tier.name &&
+ const isSameTierDifferentBilling = currentTier && currentTier.name === tier.name &&
((currentIsMonthly && targetIsYearly) || (currentIsYearly && targetIsMonthly));
if (
@@ -419,8 +419,8 @@ function PricingTier({
)}
{/* Show upgrade badge for yearly plans when user is on monthly */}
- {!tier.isPopular && isAuthenticated && currentSubscription && billingPeriod === 'yearly' &&
- currentTier && currentSubscription.price_id === currentTier.stripePriceId &&
- tier.yearlyStripePriceId && (currentTier.name === tier.name ||
- parseFloat(tier.price.slice(1)) >= parseFloat(currentTier.price.slice(1))) && (
-
- Recommended
-
- )}
+ {!tier.isPopular && isAuthenticated && currentSubscription && billingPeriod === 'yearly' &&
+ currentTier && currentSubscription.price_id === currentTier.stripePriceId &&
+ tier.yearlyStripePriceId && (currentTier.name === tier.name ||
+ parseFloat(tier.price.slice(1)) >= parseFloat(currentTier.price.slice(1))) && (
+
+ Recommended
+
+ )}
{isAuthenticated && statusBadge}
@@ -481,7 +481,7 @@ function PricingTier({
) : (
- {billingPeriod === 'yearly' && tier.yearlyPrice && displayPrice !== '$0'
+ {billingPeriod === 'yearly' && tier.yearlyPrice && displayPrice !== '$0'
? `$${Math.round(parseFloat(tier.yearlyPrice.slice(1)) / 12)}/month (billed yearly)`
: `${displayPrice}/month`
}
@@ -628,7 +628,7 @@ export function PricingSection({
return (
{showTitleAndTabs && (
<>
@@ -654,9 +654,9 @@ export function PricingSection({
)}
{deploymentType === 'cloud' && (
-
)}
@@ -667,7 +667,7 @@ export function PricingSection({
"px-6 max-w-7xl": !insideDialog,
"max-w-7xl": insideDialog
},
- insideDialog
+ insideDialog
? "grid-cols-1 sm:grid-cols-2 lg:grid-cols-2 2xl:grid-cols-4"
: "min-[650px]:grid-cols-2 lg:grid-cols-4",
!insideDialog && "grid-rows-1 items-stretch"
@@ -675,20 +675,20 @@ export function PricingSection({
{siteConfig.cloudPricingItems
.filter((tier) => !tier.hidden && (!hideFree || tier.price !== '$0'))
.map((tier) => (
-
- ))}
+
+ ))}
)}
diff --git a/frontend/src/components/thread/chat-input/chat-dropdown.tsx b/frontend/src/components/thread/chat-input/chat-dropdown.tsx
index 1d8b7718..6a8cfadd 100644
--- a/frontend/src/components/thread/chat-input/chat-dropdown.tsx
+++ b/frontend/src/components/thread/chat-input/chat-dropdown.tsx
@@ -7,6 +7,7 @@ import {
DropdownMenuItem,
DropdownMenuTrigger,
} from '@/components/ui/dropdown-menu'
+import Image from 'next/image'
const ChatDropdown = () => {
const [isOpen, setIsOpen] = useState(false)
@@ -23,7 +24,7 @@ const ChatDropdown = () => {
}}
>
-
+
Suna
diff --git a/frontend/src/components/thread/chat-input/chat-input.tsx b/frontend/src/components/thread/chat-input/chat-input.tsx
index c3701138..f41c200f 100644
--- a/frontend/src/components/thread/chat-input/chat-input.tsx
+++ b/frontend/src/components/thread/chat-input/chat-input.tsx
@@ -49,6 +49,7 @@ export interface ChatInputProps {
toolCallIndex?: number;
showToolPreview?: boolean;
onExpandToolPreview?: () => void;
+ isLoggedIn?: boolean;
}
export interface UploadedFile {
@@ -83,6 +84,7 @@ export const ChatInput = forwardRef
(
toolCallIndex = 0,
showToolPreview = false,
onExpandToolPreview,
+ isLoggedIn = true,
},
ref,
) => {
@@ -303,6 +305,7 @@ export const ChatInput = forwardRef(
subscriptionStatus={subscriptionStatus}
canAccessModel={canAccessModel}
refreshCustomModels={refreshCustomModels}
+ isLoggedIn={isLoggedIn}
selectedAgentId={selectedAgentId}
onAgentSelect={onAgentSelect}
diff --git a/frontend/src/components/thread/chat-input/file-upload-handler.tsx b/frontend/src/components/thread/chat-input/file-upload-handler.tsx
index 5617300e..a3a7cb38 100644
--- a/frontend/src/components/thread/chat-input/file-upload-handler.tsx
+++ b/frontend/src/components/thread/chat-input/file-upload-handler.tsx
@@ -179,6 +179,7 @@ interface FileUploadHandlerProps {
setUploadedFiles: React.Dispatch>;
setIsUploading: React.Dispatch>;
messages?: any[]; // Add messages prop
+ isLoggedIn?: boolean;
}
export const FileUploadHandler = forwardRef<
@@ -196,6 +197,7 @@ export const FileUploadHandler = forwardRef<
setUploadedFiles,
setIsUploading,
messages = [],
+ isLoggedIn = true,
},
ref,
) => {
@@ -246,26 +248,28 @@ export const FileUploadHandler = forwardRef<
-
+
+
+
- Attach files
+ {isLoggedIn ? 'Attach files' : 'Please login to attach files'}
diff --git a/frontend/src/components/thread/chat-input/message-input.tsx b/frontend/src/components/thread/chat-input/message-input.tsx
index 129c87f3..f7cb91b3 100644
--- a/frontend/src/components/thread/chat-input/message-input.tsx
+++ b/frontend/src/components/thread/chat-input/message-input.tsx
@@ -8,13 +8,14 @@ import { FileUploadHandler } from './file-upload-handler';
import { VoiceRecorder } from './voice-recorder';
import { ModelSelector } from './model-selector';
import { ChatSettingsDropdown } from './chat-settings-dropdown';
-import { SubscriptionStatus } from './_use-model-selection';
+import { canAccessModel, SubscriptionStatus } from './_use-model-selection';
import { isLocalMode } from '@/lib/config';
import { useFeatureFlag } from '@/lib/feature-flags';
import { TooltipContent } from '@/components/ui/tooltip';
import { Tooltip } from '@/components/ui/tooltip';
import { TooltipProvider, TooltipTrigger } from '@radix-ui/react-tooltip';
import { BillingModal } from '@/components/billing/billing-modal';
+import ChatDropdown from './chat-dropdown';
interface MessageInputProps {
value: string;
@@ -37,6 +38,7 @@ interface MessageInputProps {
setIsUploading: React.Dispatch>;
hideAttachments?: boolean;
messages?: any[]; // Add messages prop
+ isLoggedIn?: boolean;
selectedModel: string;
onModelChange: (model: string) => void;
@@ -71,6 +73,7 @@ export const MessageInput = forwardRef(
setIsUploading,
hideAttachments = false,
messages = [],
+ isLoggedIn = true,
selectedModel,
onModelChange,
@@ -122,6 +125,36 @@ export const MessageInput = forwardRef(
}
};
+ const renderDropdown = () => {
+ if (isLoggedIn) {
+ if (!customAgentsEnabled || flagsLoading) {
+ return
+ } else {
+ return
+ }
+ }
+ return ;
+ }
+
return (
@@ -156,6 +189,7 @@ export const MessageInput = forwardRef
(
setUploadedFiles={setUploadedFiles}
setIsUploading={setIsUploading}
messages={messages}
+ isLoggedIn={isLoggedIn}
/>
)}
@@ -176,30 +210,7 @@ export const MessageInput = forwardRef(
{/* Show model selector inline if custom agents are disabled, otherwise show settings dropdown */}
- {!customAgentsEnabled || flagsLoading ? (
-
- ) : (
-
- )}
+ {renderDropdown()}
{/* Billing Modal */}
(
returnUrl={typeof window !== 'undefined' ? window.location.href : '/'}
/>
-
+ />}