-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathCustomComponentsDemo.tsx
More file actions
32 lines (31 loc) · 952 Bytes
/
Copy pathCustomComponentsDemo.tsx
File metadata and controls
32 lines (31 loc) · 952 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { Component, Show } from 'solid-js';
import { KbdShortcut, ResultContentProps } from '../../../../../lib';
import utilStyles from '../../../../utils.module.css';
import styles from './CustomComponentsDemo.module.css';
export const DemoResultContent: Component<ResultContentProps> = (p) => {
return (
<div
class={styles.resultContent}
classList={{
[styles.active]: p.isActive,
}}
>
<div>
<h4 class={`${styles.resultTitle} ${utilStyles.stripSpace}`}>{p.action.title}</h4>
<Show when={p.action.subtitle}>
<p class={`${styles.resultSubtitle} ${utilStyles.stripSpace}`}>{p.action.subtitle}</p>
</Show>
</div>
<div>
<Show when={p.action.shortcut}>
{(shortcut) => (
<KbdShortcut
class={styles.resultShortcut}
shortcut={shortcut}
/>
)}
</Show>
</div>
</div>
);
};