mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 21:06:04 +00:00
finalize new media settings
This commit is contained in:
@@ -1,33 +1,17 @@
|
||||
import { IconPhoto } from "@tabler/icons-react";
|
||||
import { IconAlertHexagon } from "@tabler/icons-react";
|
||||
import { TbSettings } from "react-icons/tb";
|
||||
import { useBknd } from "ui/client/BkndProvider";
|
||||
import { IconButton } from "ui/components/buttons/IconButton";
|
||||
import { Empty } from "ui/components/display/Empty";
|
||||
import { Link } from "ui/components/wouter/Link";
|
||||
import { Media } from "ui/elements";
|
||||
import { useBrowserTitle } from "ui/hooks/use-browser-title";
|
||||
import * as AppShell from "ui/layouts/AppShell/AppShell";
|
||||
import { useLocation } from "wouter";
|
||||
|
||||
export function MediaRoot({ children }) {
|
||||
const { app, config } = useBknd();
|
||||
const [, navigate] = useLocation();
|
||||
const mediaDisabled = !config.media.enabled;
|
||||
useBrowserTitle(["Media"]);
|
||||
|
||||
if (!config.media.enabled) {
|
||||
return (
|
||||
<Empty
|
||||
Icon={IconPhoto}
|
||||
title="Media not enabled"
|
||||
description="Please enable media in the settings to continue."
|
||||
primary={{
|
||||
children: "Manage Settings",
|
||||
onClick: () => navigate(app.getSettingsPath(["media"]))
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<AppShell.Sidebar>
|
||||
@@ -42,12 +26,13 @@ export function MediaRoot({ children }) {
|
||||
</AppShell.SectionHeader>
|
||||
<AppShell.Scrollable initialOffset={96}>
|
||||
<div className="flex flex-col flex-grow p-3 gap-3">
|
||||
{/*<div>
|
||||
<SearchInput placeholder="Search buckets" />
|
||||
</div>*/}
|
||||
<nav className="flex flex-col flex-1 gap-1">
|
||||
<AppShell.SidebarLink as={Link} href={"/"}>
|
||||
Main Bucket
|
||||
<AppShell.SidebarLink
|
||||
as={Link}
|
||||
href={"/"}
|
||||
className="flex flex-row justify-between"
|
||||
>
|
||||
Main Bucket {mediaDisabled && <IconAlertHexagon className="size-5" />}
|
||||
</AppShell.SidebarLink>
|
||||
<AppShell.SidebarLink as={Link} href={"/settings"}>
|
||||
Settings
|
||||
|
||||
Reference in New Issue
Block a user