Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

import { useEffect, useRef, useState } from 'react';
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
import {
AUTOMATION_RECOMMENDATION_CATALOG,
type AutomationRecommendationBatch,
} from '@roomote/types';
import type { AutomationRecommendationBatch } from '@roomote/types';
import {
Alert,
AlertDescription,
Expand All @@ -23,12 +20,10 @@ import { getSetupStepDefinition } from './types';

const STEP = getSetupStepDefinition('automation-recommendations');

function candidateTitle(candidateId: string) {
return (
AUTOMATION_RECOMMENDATION_CATALOG.find(
(candidate) => candidate.id === candidateId,
)?.title ?? candidateId
);
function candidateTitle(
recommendation: AutomationRecommendationBatch['recommendations'][number],
) {
return recommendation.title ?? recommendation.candidateId;
}

export function StepAutomationRecommendations({
Expand Down Expand Up @@ -194,7 +189,7 @@ export function StepAutomationRecommendations({
/>
<div className="min-w-0 flex-1">
<p className="text-sm font-semibold">
{candidateTitle(recommendation.candidateId)}
{candidateTitle(recommendation)}
</p>
<p className="text-sm text-muted-foreground">
{recommendation.explanation}
Expand Down
266 changes: 80 additions & 186 deletions apps/web/src/trpc/commands/setup-new/index.test.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading