diff --git a/src/Components/Configuration/EditCard/Base.tsx b/src/Components/Configuration/EditCard/Base.tsx index a75a14d35..0cc429e92 100644 --- a/src/Components/Configuration/EditCard/Base.tsx +++ b/src/Components/Configuration/EditCard/Base.tsx @@ -92,8 +92,8 @@ function Base(props: BaseExtendedProps): ReactElement | null { className={classes.textField} InputLabelProps={{ shrink: true }} label="Title" - placeholder={'Card Title'} - value={props.card.title} + placeholder="Card Title" + value={props.card.title || 'Card'} onChange={props.handleChange && props.handleChange('title')} /> @@ -112,7 +112,7 @@ function Base(props: BaseExtendedProps): ReactElement | null { Type diff --git a/src/Components/Configuration/EditCard/Entity.tsx b/src/Components/Configuration/EditCard/Entity.tsx index e43ffda80..aa5c34af9 100644 --- a/src/Components/Configuration/EditCard/Entity.tsx +++ b/src/Components/Configuration/EditCard/Entity.tsx @@ -102,7 +102,7 @@ function Entity(props: EntityProps): ReactElement { InputLabelProps={{ shrink: true }} label="Entity" placeholder="sensor.myamazingsensor" - value={props.card.entity} + value={props.card.entity || ''} onChange={props.handleChange && props.handleChange('entity')} /> )} @@ -121,7 +121,7 @@ function Entity(props: EntityProps): ReactElement { InputLabelProps={{ shrink: true }} label="Icon" placeholder="thermometer" - value={props.card.icon} + value={props.card.icon || ''} onChange={props.handleChange && props.handleChange('icon')} /> @@ -152,7 +152,7 @@ function Entity(props: EntityProps): ReactElement { type="text" label="Icon Size" placeholder="initial" - value={props.card.icon_size} + value={props.card.icon_size || 'initial'} onChange={props.handleChange && props.handleChange('icon_size')} /> @@ -165,7 +165,7 @@ function Entity(props: EntityProps): ReactElement { type="text" label="State Font Size" placeholder="initial" - value={props.card.state_size} + value={props.card.state_size || 'initial'} onChange={ props.handleChange && props.handleChange('state_size') } @@ -184,7 +184,7 @@ function Entity(props: EntityProps): ReactElement { Chart @@ -33,7 +33,7 @@ function Frame(props: BaseProps): ReactElement { InputLabelProps={{ shrink: true }} label="Height" placeholder="auto" - value={props.card.height} + value={props.card.height || 'auto'} onChange={props.handleChange && props.handleChange('height')} /> diff --git a/src/Components/Configuration/EditCard/Image.tsx b/src/Components/Configuration/EditCard/Image.tsx index 1c5e80cce..a8acaf683 100644 --- a/src/Components/Configuration/EditCard/Image.tsx +++ b/src/Components/Configuration/EditCard/Image.tsx @@ -23,7 +23,7 @@ function Image(props: BaseProps): ReactElement { InputLabelProps={{ shrink: true }} label="URL" placeholder="https://timmo.dev/home-panel" - value={props.card.url} + value={props.card.url || ''} onChange={props.handleChange && props.handleChange('url')} /> diff --git a/src/Components/Configuration/EditCard/Markdown.tsx b/src/Components/Configuration/EditCard/Markdown.tsx index 86962cbf0..64e10cbf6 100644 --- a/src/Components/Configuration/EditCard/Markdown.tsx +++ b/src/Components/Configuration/EditCard/Markdown.tsx @@ -24,7 +24,7 @@ function Markdown(props: BaseProps): ReactElement { multiline label="Content" placeholder="- Markdown" - value={props.card.content} + value={props.card.content || ''} onChange={props.handleChange && props.handleChange('content')} /> @@ -34,7 +34,7 @@ function Markdown(props: BaseProps): ReactElement { InputLabelProps={{ shrink: true }} label="Height" placeholder="auto" - value={props.card.height} + value={props.card.height || 'auto'} onChange={props.handleChange && props.handleChange('height')} /> diff --git a/src/Components/Configuration/EditCard/News.tsx b/src/Components/Configuration/EditCard/News.tsx index e4b319a94..778e9c129 100644 --- a/src/Components/Configuration/EditCard/News.tsx +++ b/src/Components/Configuration/EditCard/News.tsx @@ -28,7 +28,7 @@ const useStyles = makeStyles(() => ({ function News(props: BaseProps): ReactElement { const [sources, setSources] = useState(); - const [source, setSource] = useState diff --git a/src/Components/HomeAssistant/Utils/EntitySelect.tsx b/src/Components/HomeAssistant/Utils/EntitySelect.tsx index fa9d2ed41..6837bc478 100644 --- a/src/Components/HomeAssistant/Utils/EntitySelect.tsx +++ b/src/Components/HomeAssistant/Utils/EntitySelect.tsx @@ -28,7 +28,7 @@ function EntitySelect(props: EntitySelectProps): ReactElement { const classes = useStyles(); const [options, setOptions] = useState([]); - const [value, setValue] = useState