mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-04-20 08:20:02 +02:00
updates Adding_Components.md
This commit is contained in:
parent
d0869b707b
commit
d517bd0489
@ -115,13 +115,14 @@ import { Card, Collapse, Image } from 'react-bootstrap';
|
|||||||
import { DocStringComponent } from './DocStringComponent';
|
import { DocStringComponent } from './DocStringComponent';
|
||||||
import { ChevronDown, ChevronRight } from 'react-bootstrap-icons';
|
import { ChevronDown, ChevronRight } from 'react-bootstrap-icons';
|
||||||
import { getIdFromFullAccessPath } from '../utils/stringUtils';
|
import { getIdFromFullAccessPath } from '../utils/stringUtils';
|
||||||
|
import { LevelName } from './NotificationsComponent';
|
||||||
|
|
||||||
interface ImageComponentProps {
|
interface ImageComponentProps {
|
||||||
name: string;
|
name: string;
|
||||||
parentPath: string;
|
parentPath: string;
|
||||||
readOnly: boolean;
|
readOnly: boolean;
|
||||||
docString: string;
|
docString: string;
|
||||||
addNotification: (message: string) => void;
|
addNotification: (message: string, levelname?: LevelName) => void;
|
||||||
// Define your component specific props here
|
// Define your component specific props here
|
||||||
value: string;
|
value: string;
|
||||||
format: string;
|
format: string;
|
||||||
@ -299,6 +300,7 @@ useEffect(() => {
|
|||||||
```
|
```
|
||||||
|
|
||||||
However, you might want to use the `addNotification` at different places. For an example, see the [MethodComponent](../../frontend/src/components/MethodComponent.tsx).
|
However, you might want to use the `addNotification` at different places. For an example, see the [MethodComponent](../../frontend/src/components/MethodComponent.tsx).
|
||||||
|
**Note**: you can specify the notification level by passing a string of type `LevelName` (one of 'CRITICAL', 'ERROR', 'WARNING', 'INFO', 'DEBUG'). The default value is 'DEBUG'.
|
||||||
|
|
||||||
### Step 6: Write Tests for the Component (TODO)
|
### Step 6: Write Tests for the Component (TODO)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user