mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 23:27:12 +01:00
Empty placeholder component. CSS fixes.
This commit is contained in:
parent
cd76cc895f
commit
e309376150
8 changed files with 85 additions and 19 deletions
|
|
@ -9,6 +9,7 @@ import Button from './common/Button';
|
|||
import PageHeader from './layout/PageHeader';
|
||||
import Arrow from 'assets/arrow-right.svg';
|
||||
import styles from './WebsiteList.module.css';
|
||||
import EmptyPlaceholder from './common/EmptyPlaceholder';
|
||||
|
||||
export default function WebsiteList() {
|
||||
const [data, setData] = useState();
|
||||
|
|
@ -22,6 +23,10 @@ export default function WebsiteList() {
|
|||
loadData();
|
||||
}, []);
|
||||
|
||||
if (!data) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Page>
|
||||
{data?.map(({ website_id, name }) => (
|
||||
|
|
@ -51,6 +56,13 @@ export default function WebsiteList() {
|
|||
<WebsiteChart key={website_id} title={name} websiteId={website_id} />
|
||||
</div>
|
||||
))}
|
||||
{data.length === 0 && (
|
||||
<EmptyPlaceholder msg={"You don't have any websites configured."}>
|
||||
<Button icon={<Arrow />} size="medium" onClick={() => router.push('/settings')}>
|
||||
<div>Go to settings</div>
|
||||
</Button>
|
||||
</EmptyPlaceholder>
|
||||
)}
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue