kyd-shared-badge 0.3.29 → 0.3.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/SharedBadgeDisplay.tsx +7 -1
- package/src/components/UseCases.tsx +49 -0
- package/src/types.ts +13 -0
package/package.json
CHANGED
|
@@ -24,6 +24,7 @@ import { BusinessRulesProvider } from './components/BusinessRulesContext';
|
|
|
24
24
|
import Reveal from './components/Reveal';
|
|
25
25
|
import { formatLocalDateTime } from './utils/date';
|
|
26
26
|
import ChatWidget from './chat/ChatWidget';
|
|
27
|
+
import UseCases from './components/UseCases';
|
|
27
28
|
type ChatWidgetProps = Partial<{
|
|
28
29
|
api: string;
|
|
29
30
|
title: string;
|
|
@@ -181,7 +182,7 @@ const SharedBadgeDisplay = ({ badgeData, chatProps, headless }: { badgeData: Pub
|
|
|
181
182
|
</Reveal>
|
|
182
183
|
{/* Coaching / Evidence under header when present */}
|
|
183
184
|
{(() => {
|
|
184
|
-
const em =
|
|
185
|
+
const em = assessmentResult.enterprise_match;
|
|
185
186
|
const coaching = em?.coaching;
|
|
186
187
|
if (!coaching || !(Array.isArray(coaching.items) && coaching.items.length)) return null;
|
|
187
188
|
return (
|
|
@@ -260,6 +261,11 @@ const SharedBadgeDisplay = ({ badgeData, chatProps, headless }: { badgeData: Pub
|
|
|
260
261
|
</Reveal>
|
|
261
262
|
</div>
|
|
262
263
|
|
|
264
|
+
{/* Enterprise Use Cases (directly under the three summary cards) */}
|
|
265
|
+
{assessmentResult?.enterprise_use_cases?.items && assessmentResult.enterprise_use_cases.items.length > 0 && (
|
|
266
|
+
<UseCases useCases={assessmentResult.enterprise_use_cases} headless={isHeadless} />
|
|
267
|
+
)}
|
|
268
|
+
|
|
263
269
|
{/* Technical Scores */}
|
|
264
270
|
<div className="mt-8" >
|
|
265
271
|
<div key={'Technical'} className='pt-8 space-y-8 kyd-avoid-break' style={{ borderColor: 'var(--icon-button-secondary)'}}>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import Reveal from './Reveal';
|
|
4
|
+
import { EnterpriseUseCases, UseCaseItem } from '../types';
|
|
5
|
+
|
|
6
|
+
export default function UseCases({ useCases, headless }: { useCases?: EnterpriseUseCases | null; headless?: boolean }) {
|
|
7
|
+
if (!useCases || !Array.isArray(useCases.items) || useCases.items.length === 0) return null;
|
|
8
|
+
|
|
9
|
+
const items: UseCaseItem[] = useCases.items.slice(0, 4);
|
|
10
|
+
const note = (useCases.note || '').trim();
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<Reveal headless={!!headless}>
|
|
14
|
+
<div className={'pt-8 kyd-avoid-break'}>
|
|
15
|
+
<h3 className={'text-2xl font-semibold mb-3'} style={{ color: 'var(--text-main)' }}>Potential Use Cases</h3>
|
|
16
|
+
<div className={'grid grid-cols-1 md:grid-cols-2 gap-4'}>
|
|
17
|
+
{items.map((uc, idx) => (
|
|
18
|
+
<div key={idx} className={'rounded-md p-5 border'} style={{ backgroundColor: 'var(--content-card-background)', borderColor: 'var(--icon-button-secondary)' }}>
|
|
19
|
+
<div className={'font-semibold'} style={{ color: 'var(--text-main)' }}>{uc.title}</div>
|
|
20
|
+
{uc.potential_impact ? (
|
|
21
|
+
<div className={'text-sm mt-2'} style={{ color: 'var(--text-secondary)' }}>
|
|
22
|
+
<span className={'font-medium'} style={{ color: 'var(--text-main)' }}>Potential Impact: </span>
|
|
23
|
+
{uc.potential_impact}
|
|
24
|
+
</div>
|
|
25
|
+
) : null}
|
|
26
|
+
{uc.demonstrated_capability ? (
|
|
27
|
+
<div className={'text-sm mt-1'} style={{ color: 'var(--text-secondary)' }}>
|
|
28
|
+
<span className={'font-medium'} style={{ color: 'var(--text-main)' }}>Demonstrated Capability: </span>
|
|
29
|
+
{uc.demonstrated_capability}
|
|
30
|
+
</div>
|
|
31
|
+
) : null}
|
|
32
|
+
{uc.justification ? (
|
|
33
|
+
<div className={'text-sm mt-1'} style={{ color: 'var(--text-secondary)' }}>
|
|
34
|
+
<span className={'font-medium'} style={{ color: 'var(--text-main)' }}>Justification: </span>
|
|
35
|
+
{uc.justification}
|
|
36
|
+
</div>
|
|
37
|
+
) : null}
|
|
38
|
+
</div>
|
|
39
|
+
))}
|
|
40
|
+
</div>
|
|
41
|
+
{note ? (
|
|
42
|
+
<div className={'text-xs mt-3'} style={{ color: 'var(--text-secondary)' }}>{note}</div>
|
|
43
|
+
) : null}
|
|
44
|
+
</div>
|
|
45
|
+
</Reveal>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
package/src/types.ts
CHANGED
|
@@ -176,6 +176,18 @@ export interface EnterpriseMatch {
|
|
|
176
176
|
coaching?: EnterpriseCoaching;
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
+
export interface UseCaseItem {
|
|
180
|
+
title: string;
|
|
181
|
+
potential_impact: string;
|
|
182
|
+
demonstrated_capability: string;
|
|
183
|
+
justification: string;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export interface EnterpriseUseCases {
|
|
187
|
+
items: UseCaseItem[];
|
|
188
|
+
note?: string;
|
|
189
|
+
}
|
|
190
|
+
|
|
179
191
|
|
|
180
192
|
export interface AssessmentResult {
|
|
181
193
|
final_percent: number;
|
|
@@ -248,6 +260,7 @@ export interface AssessmentResult {
|
|
|
248
260
|
skills_all?: SkillsAll;
|
|
249
261
|
graph_insights?: GraphInsightsPayload;
|
|
250
262
|
enterprise_match?: EnterpriseMatch;
|
|
263
|
+
enterprise_use_cases?: EnterpriseUseCases;
|
|
251
264
|
}
|
|
252
265
|
export interface ClientMetadata {
|
|
253
266
|
ipAddress: string;
|