|
1 | | -import ChatInterface from "./ChatInterface" |
2 | | -import LightBulbIcon from "@heroicons/react/24/solid/LightBulbIcon" |
3 | | -import ChatBubbleOvalLeftEllipsisIcon from "@heroicons/react/24/solid/ChatBubbleOvalLeftEllipsisIcon" |
| 1 | +import Markdown from "markdown-to-jsx" |
4 | 2 |
|
5 | | -const InsightBox = ({ title, description }: { title: string; description: string }) => { |
6 | | - return ( |
7 | | - <div className="w-full flex flex-row rounded-lg border border-blue-200"> |
8 | | - <div className="h-full w-12 flex flex-col justify-start items-center py-4 px-2 "> |
9 | | - <div className="flex items-center justify-center h-8 w-8 bg-blue-100 rounded-lg"> |
10 | | - <LightBulbIcon className="h-4" /> |
11 | | - </div> |
12 | | - </div> |
13 | | - <div className="p-4"> |
14 | | - <h4 className="font-medium text-blue-900 mb-2">{title}</h4> |
15 | | - <p className="text-sm text-blue-800">{description}</p> |
16 | | - </div> |
17 | | - </div> |
18 | | - ) |
19 | | -} |
| 3 | +const markdownContent = ` |
| 4 | +# Executive summary |
| 5 | +
|
| 6 | +Significant housing-jobs mismatches exist among East Bay affordable housing applicants, with 52.7% commuting between different cities for work. |
| 7 | +
|
| 8 | +## Key numbers: |
| 9 | +
|
| 10 | +- **Cross-city commuters:** 7,005 applicants (52.7%) |
| 11 | +- **Oakland residential dominance:** 5,129 applicants (38.6%) |
| 12 | +- **Central Corridor employment concentration:** 3,663 workers (52.2%) |
| 13 | +
|
| 14 | +# Data summary |
| 15 | +
|
| 16 | +## Highest Demand: |
| 17 | +
|
| 18 | +Central Corridor (Oakland-Berkeley-Alameda) with 5,997 applicants (45.4%) |
| 19 | +
|
| 20 | +## Distribution patterns: |
| 21 | +
|
| 22 | +- **Residential:** Central Corridor (45.1%), Peninsula Transition (10.0%), Southern Cluster (11.4%) |
| 23 | +- **Employment:** Central Corridor (52.2%), Southern Cluster (22.0%), Peninsula Transition (10.0%) |
| 24 | +- **Commute:** 52.7% work outside their residential city, 79.5% live in BART-accessible areas |
| 25 | +
|
| 26 | +# Cross-analysis: |
| 27 | +
|
| 28 | +- Same-city living and working: 6,288 applicants (47.3%) |
| 29 | +- Cross-cluster commuting: 4,278 applicants (32.2%) |
| 30 | +- Largest commute flow: 1,278 from Central Corridor to Southern Cluster |
| 31 | +- BART accessibility: 10,574 applicants (79.5%) |
| 32 | +` |
20 | 33 |
|
21 | 34 | export const AiInsightsPanel = () => { |
22 | 35 | return ( |
23 | | - <div className="flex flex-col h-full"> |
24 | | - <h3 className="text-lg font-semibold text-gray-900 mb-4">AI Insights</h3> |
25 | | - |
26 | | - {/* Static Insights */} |
27 | | - <div className="space-y-4 mb-6"> |
28 | | - <InsightBox |
29 | | - title="Application Trends" |
30 | | - description="Your community has seen a steady increase in applications over the past year, with a peak in Q2." |
31 | | - /> |
32 | | - <InsightBox |
33 | | - title="Household Composition" |
34 | | - description="Family sizes are well-distributed across unit types, indicating diverse housing needs in |
35 | | - your community." |
36 | | - /> |
| 36 | + <div className="flex flex-col h-full w-full rounded-lg p-6"> |
| 37 | + {/* Markdown Content */} |
| 38 | + <div className="markdown-content mb-6"> |
| 39 | + <Markdown |
| 40 | + options={{ |
| 41 | + overrides: { |
| 42 | + h1: { |
| 43 | + component: "h3", |
| 44 | + props: { |
| 45 | + className: "text-xl font-semibold text-gray-900 mb-4 mt-6 first:mt-0", |
| 46 | + }, |
| 47 | + }, |
| 48 | + h2: { |
| 49 | + component: "h4", |
| 50 | + props: { |
| 51 | + className: "text-base font-semibold text-gray-900 mb-3 mt-4", |
| 52 | + }, |
| 53 | + }, |
| 54 | + p: { |
| 55 | + props: { |
| 56 | + className: "text-sm text-gray-700 leading-relaxed mb-4", |
| 57 | + }, |
| 58 | + }, |
| 59 | + ul: { |
| 60 | + props: { |
| 61 | + className: "text-sm text-gray-700 space-y-2 mb-4", |
| 62 | + }, |
| 63 | + }, |
| 64 | + li: { |
| 65 | + props: { |
| 66 | + className: "ml-4", |
| 67 | + }, |
| 68 | + }, |
| 69 | + }, |
| 70 | + }} |
| 71 | + > |
| 72 | + {markdownContent} |
| 73 | + </Markdown> |
37 | 74 | </div> |
38 | 75 |
|
39 | 76 | {/* Chat Interface */} |
40 | | - <div className="flex-1 flex flex-col border border-gray-200 rounded-lg bg-white"> |
41 | | - <div className="bg-gray-50 px-4 py-3 border-b border-gray-200 rounded-t-lg"> |
42 | | - <h4 className="font-medium text-gray-900 flex items-center"> |
43 | | - <ChatBubbleOvalLeftEllipsisIcon className="h-6 pr-2" />{" "} |
44 | | - <p className="text-base">Ask our assistant for help exploring your data</p> |
45 | | - </h4> |
| 77 | + {/* <div className="mt-auto pt-4 border-t-2 border-dashed border-blue-300"> |
| 78 | + <div className="bg-white border border-gray-200 rounded-lg"> |
| 79 | + <div className="bg-gray-50 px-4 py-3 border-b border-gray-200 rounded-t-lg"> |
| 80 | + <h4 className="font-medium text-gray-900 flex items-center"> |
| 81 | + <ChatBubbleOvalLeftEllipsisIcon className="h-5 w-5 mr-2" /> |
| 82 | + <span className="text-sm">Ask for more insights</span> |
| 83 | + </h4> |
| 84 | + </div> |
| 85 | + <ChatInterface /> |
46 | 86 | </div> |
47 | | - |
48 | | - <ChatInterface /> |
49 | | - </div> |
| 87 | + </div> */} |
50 | 88 | </div> |
51 | 89 | ) |
52 | 90 | } |
0 commit comments