Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions apps/web/src/components/settings/SettingsShell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ import { PageNavigationShell } from './PageNavigationShell';
type SettingsShellProps = {
pageId: SettingsPageId;
adminOnly?: boolean;
headerAction?: ReactNode;
children: ReactNode;
};

export function SettingsShell({
pageId,
adminOnly = false,
headerAction,
children,
}: SettingsShellProps) {
const router = useRouter();
Expand All @@ -49,6 +51,7 @@ export function SettingsShell({
title={navigationItem.title}
description={navigationItem.description}
mobileLabel="Settings page"
headerAction={headerAction}
onItemSelect={(value) => {
const nextItem = accessibleItems.find((item) => item.id === value);
if (nextItem) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ import {
Alert,
AlertCircle,
AlertDescription,
Button,
Lightbulb,
BookOpenText,
HeaderCallout,
} from '@/components/system';
import { BookOpenText } from 'lucide-react';

export function AutomationsSettingsPage() {
const { isAdmin } = useAuthorizedUser();
Expand All @@ -30,22 +29,12 @@ export function AutomationsSettingsPage() {
Get {PRODUCT_NAME} automatically working on your behalf.
</p>
</div>
<div className="flex flex-wrap shrink-0 -mt-4 md:mt-3 items-center gap-2 text-sm animate-[enter-down_1s_1_2000ms_backwards]">
<Lightbulb className="size-4 shrink-0 text-muted-foreground hidden lg:block" />
<div>
<span className="mr-1">Unsure how automations can help?</span>
<Button asChild variant="link" className="inline" size="sm">
<a
href={DOCS_COOKBOOK_URL}
target="_blank"
rel="noopener noreferrer"
>
<BookOpenText className="hidden md:inline mr-1" />
Explore recipes
</a>
</Button>
</div>
</div>
<HeaderCallout
icon={BookOpenText}
text="Unsure how automations can help?"
action={DOCS_COOKBOOK_URL}
buttonLabel="Explore recipes"
/>
</header>

{isAdmin ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ import { InferenceProviderSection } from '@/components/settings/InferenceProvide
import { ModelSettingsSection } from '@/components/settings/ModelSettingsSection';
import { SettingsShell } from '@/components/settings/SettingsShell';
import { splitInferenceProviders } from '@/components/settings/taskModelProviderSetup';
import { HeaderCallout, Medal } from '@/components/system';
import { useTRPC } from '@/trpc/client';

const MODEL_RECOMMENDATIONS_URL = 'https://roomote.dev/evals';

export function TaskModelSettingsPage() {
const trpc = useTRPC();
const providerSetupQuery = useQuery(
Expand All @@ -18,10 +21,23 @@ export function TaskModelSettingsPage() {
const { connectedProviders, availableProviders } =
splitInferenceProviders(providerSetup);
const modelSectionRef = useRef<HTMLDivElement | null>(null);
const recommendationsCallout = (
<HeaderCallout
icon={Medal}
text="Need help picking the best model?"
action={MODEL_RECOMMENDATIONS_URL}
buttonLabel="View Recs"
/>
);

return (
<SettingsShell pageId="models" adminOnly={true}>
<SettingsShell
pageId="models"
adminOnly={true}
headerAction={recommendationsCallout}
>
<div className="space-y-6">
<div className="md:hidden">{recommendationsCallout}</div>
<InferenceProviderSection
providerSetup={providerSetup}
providerSetupPending={providerSetupQuery.isPending}
Expand Down
31 changes: 31 additions & 0 deletions apps/web/src/components/system/custom/header-callout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { Button } from '../primitives/button';
import { Lightbulb, type LucideIcon } from '../primitives/icons';

type HeaderCalloutProps = {
icon: LucideIcon;
text: string;
action: string;
buttonLabel: string;
};

export function HeaderCallout({
icon: Icon,
text,
action,
buttonLabel,
}: HeaderCalloutProps) {
return (
<div className="flex flex-wrap shrink-0 -mt-4 md:mt-3 items-center gap-2 text-sm animate-[enter-down_1s_1_2000ms_backwards]">
<Lightbulb className="size-4 shrink-0 text-muted-foreground hidden lg:block" />
<div>
<span className="mr-1">{text}</span>
<Button asChild variant="link" className="inline" size="sm">
<a href={action} target="_blank" rel="noopener noreferrer">
<Icon className="hidden md:inline mr-1" />
{buttonLabel}
</a>
</Button>
</div>
</div>
);
}
1 change: 1 addition & 0 deletions apps/web/src/components/system/custom/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export * from './ascii-spinner';
export * from './cursor-pagination';
export * from './header-callout';
export * from './MediaViewer';
export * from './icons';
export * from './logos';
Expand Down
2 changes: 2 additions & 0 deletions apps/web/src/components/system/primitives/icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export {
ArrowUpFromLine,
ArrowUpRightIcon,
AtSignIcon,
BookOpenText,
BookCopy,
BookMarked,
Brain,
Expand Down Expand Up @@ -117,6 +118,7 @@ export {
MailIcon,
Mails,
Maximize2,
Medal,
Menu,
Megaphone,
MessageCircleQuestionMark,
Expand Down
Loading