mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 09:45:22 +03:00
Add error
This commit is contained in:
parent
31753aec96
commit
a8c0c64303
@ -1,4 +1,4 @@
|
||||
import { h, Fragment } from 'preact';
|
||||
import { h } from 'preact';
|
||||
import useSWR from 'swr';
|
||||
import CodeEditor from '@uiw/react-textarea-code-editor';
|
||||
import ActivityIndicator from '../components/ActivityIndicator';
|
||||
@ -8,6 +8,7 @@ import { useState } from 'preact/hooks';
|
||||
export default function Config() {
|
||||
const { data: config } = useSWR('config/raw');
|
||||
const [newCode, setNewCode] = useState(config);
|
||||
const [error, setError] = useState();
|
||||
|
||||
if (!config) {
|
||||
return <ActivityIndicator />;
|
||||
@ -17,6 +18,8 @@ export default function Config() {
|
||||
<div className="space-y-4 p-2 px-4">
|
||||
<Heading>Config</Heading>
|
||||
|
||||
{error && <div className="max-h-20 text-red-500">There is an error</div>}
|
||||
|
||||
<CodeEditor value={config} language="yaml" onChange={(e) => setNewCode(e.target.value)} />
|
||||
</div>
|
||||
);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user