Run pre-commit hooks over existing codebase
Co-Authored-By: Ben Phelps <ben@phelps.io>
This commit is contained in:
1 parent
fa50bbad9c
commit
19c25713c4
387 files changed
+4785
-4109
No files matched your search
@@ -1,10 +1,10 @@
|
||||
import useSWR from "swr"
|
||||
|
||||
export default function FileContent({ path, loadingValue, errorValue, emptyValue = '' }) {
|
||||
const fetcher = (url) => fetch(url).then((res) => res.text())
|
||||
const { data, error, isLoading } = useSWR(`/api/config/${ path }`, fetcher)
|
||||
|
||||
if (error) return (errorValue)
|
||||
if (isLoading) return (loadingValue)
|
||||
return (data || emptyValue)
|
||||
}
|
||||
import useSWR from "swr";
|
||||
|
||||
export default function FileContent({ path, loadingValue, errorValue, emptyValue = "" }) {
|
||||
const fetcher = (url) => fetch(url).then((res) => res.text());
|
||||
const { data, error, isLoading } = useSWR(`/api/config/${path}`, fetcher);
|
||||
|
||||
if (error) return errorValue;
|
||||
if (isLoading) return loadingValue;
|
||||
return data || emptyValue;
|
||||
}
|
||||
Reference in new issue
Block a user