Cleanup names of cameras, zones, & labels in the UI (#3708)

* Cleanup names of cameras, zones, & labels in the UI

* Fix tests to include camera name
This commit is contained in:
Nicolas Mowen
2022-08-25 05:44:34 -06:00
committed by GitHub
parent 911d6fdfa7
commit 0d6dd1ed0f
7 changed files with 16 additions and 11 deletions

View File

@@ -50,6 +50,10 @@ function Camera({ name }) {
{ name: 'Recordings', href: `/recording/${name}` },
];
}, [name]);
const cleanName = useMemo(
() => { return `${name.replaceAll('_', ' ')}` },
[name]
);
const icons = useMemo(
() => [
{
@@ -81,6 +85,6 @@ function Camera({ name }) {
);
return (
<Card buttons={buttons} href={href} header={name} icons={icons} media={<CameraImage camera={name} stretch />} />
<Card buttons={buttons} href={href} header={cleanName} icons={icons} media={<CameraImage camera={name} stretch />} />
);
}