@gravity-ai/react 1.0.0 → 1.0.1
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/README.md +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ function ChatMessage({ messages }) {
|
|
|
23
23
|
const [ad, setAd] = useState(null);
|
|
24
24
|
|
|
25
25
|
useEffect(() => {
|
|
26
|
-
client.
|
|
26
|
+
client.getAd({
|
|
27
27
|
messages,
|
|
28
28
|
sessionId: 'session-123',
|
|
29
29
|
userId: 'user-456',
|
|
@@ -64,7 +64,7 @@ import { AdBanner } from '@gravity-ai/react';
|
|
|
64
64
|
|
|
65
65
|
| Prop | Type | Default | Description |
|
|
66
66
|
|------|------|---------|-------------|
|
|
67
|
-
| `ad` | `
|
|
67
|
+
| `ad` | `Ad \| null` | required | A single ad object (e.g., `response.ads[0]`) |
|
|
68
68
|
| `theme` | `'light' \| 'dark' \| 'minimal' \| 'branded'` | `'light'` | Visual theme preset |
|
|
69
69
|
| `size` | `'small' \| 'medium' \| 'large' \| 'responsive'` | `'medium'` | Size preset |
|
|
70
70
|
| `className` | `string` | - | Custom class name for container |
|
|
@@ -100,7 +100,7 @@ import { AdText } from '@gravity-ai/react';
|
|
|
100
100
|
|
|
101
101
|
| Prop | Type | Default | Description |
|
|
102
102
|
|------|------|---------|-------------|
|
|
103
|
-
| `ad` | `
|
|
103
|
+
| `ad` | `Ad \| null` | required | A single ad object (e.g., `response.ads[0]`) |
|
|
104
104
|
| `className` | `string` | - | Custom class name |
|
|
105
105
|
| `style` | `CSSProperties` | - | Custom inline styles |
|
|
106
106
|
| `fallback` | `ReactNode` | `null` | Content when ad is null |
|
|
@@ -161,7 +161,7 @@ function CustomAdComponent({ ad }) {
|
|
|
161
161
|
Full TypeScript support with exported types:
|
|
162
162
|
|
|
163
163
|
```tsx
|
|
164
|
-
import type {
|
|
164
|
+
import type { Ad, AdBannerProps, AdTheme, AdSize } from '@gravity-ai/react';
|
|
165
165
|
```
|
|
166
166
|
|
|
167
167
|
## License
|