Update roadmap title

feat/ai-autocomplete
Kamran Ahmed 8 months ago
parent 1e118bfb5f
commit 2e48ae1f1f
  1. 5
      src/components/GenerateRoadmap/GenerateRoadmap.tsx
  2. 2
      src/components/GenerateRoadmap/RoadmapSearch.tsx

@ -168,10 +168,13 @@ export function GenerateRoadmap() {
const roadmapId = result.match(ROADMAP_ID_REGEX)?.[1] || '';
setUrlParams({ id: roadmapId });
result = result.replace(ROADMAP_ID_REGEX, '');
const roadmapTitle =
result.trim().split('\n')[0]?.replace('#', '')?.trim() || term;
setRoadmapTerm(roadmapTitle);
setCurrentRoadmap({
id: roadmapId,
term: roadmapTerm,
title: term,
title: roadmapTitle,
data: result,
});
}

@ -253,7 +253,7 @@ export function RoadmapSearch(props: RoadmapSearchProps) {
>
{limitUsed} of {limit}
</span>{' '}
roadmaps.
roadmaps today.
</p>
{isAuthenticatedUser && (
<p className="flex items-center text-sm">

Loading…
Cancel
Save