feat: update sidebar ui

This commit is contained in:
ivannoskov
2026-01-21 10:36:08 +03:00
parent 1f36a074af
commit 0af5cd7458
8 changed files with 214 additions and 160 deletions

View File

@@ -0,0 +1,5 @@
import { redirect } from "next/navigation"
export default function AnalyticsPage({ params }: { params: { workspaceId: string } }) {
redirect(`/dashboard/${params.workspaceId}/analytics/projects`)
}

View File

@@ -127,7 +127,7 @@ const getCreativeWord = (count: number): string => {
export default function CreativesPage() {
const params = useParams();
const workspaceId = params?.workspaceId as string;
const { selectedProjects, getProjectFilterId, allProjectsSelected, hasPermission } = useWorkspace();
const { selectedProjects, getProjectFilterId, allProjectsSelected, hasPermission, currentProject } = useWorkspace();
const projectFilterId = getProjectFilterId();
const [creatives, setCreatives] = useState<Creative[]>([]);
@@ -613,22 +613,25 @@ export default function CreativesPage() {
<li>Креатив автоматически отобразится на платформе</li>
</ol>
</div>
<div className="flex justify-end gap-2 pt-2">
<Button
variant="outline"
onClick={() => setShowCreateDialog(false)}
>
Понятно
</Button>
<Button
onClick={() => {
window.open(`https://t.me/${BOT_USERNAME}`, "_blank");
setShowCreateDialog(false);
}}
>
Открыть бота
</Button>
</div>
<div className="flex justify-end gap-2 pt-2">
<Button
variant="outline"
onClick={() => setShowCreateDialog(false)}
>
Понятно
</Button>
<Button
onClick={() => {
const botUrl = currentProject
? `https://t.me/${BOT_USERNAME}?start=project_${currentProject.id}_createcreative`
: `https://t.me/${BOT_USERNAME}`;
window.open(botUrl, "_blank");
setShowCreateDialog(false);
}}
>
Открыть бота
</Button>
</div>
</div>
</DialogContent>
</Dialog>

View File

@@ -342,8 +342,8 @@ export default function PurchasePlanDetailPage() {
<DashboardHeader
breadcrumbs={[
{ label: "Главная", href: `/dashboard/${workspaceId}` },
{ label: "Планы закупок", href: `/dashboard/${workspaceId}/purchase-plans` },
{ label: project?.title || "План закупок" },
{ label: "Планы закупов", href: `/dashboard/${workspaceId}/purchase-plans` },
{ label: project?.title || "План закупов" },
]}
/>
@@ -360,7 +360,7 @@ export default function PurchasePlanDetailPage() {
</Button>
<div>
<h1 className="text-2xl font-bold tracking-tight">
План закупок: {project?.title}
План закупов: {project?.title}
</h1>
<p className="text-muted-foreground">
{stats.totalChannels} каналов Планируемый бюджет:{" "}
@@ -577,7 +577,7 @@ export default function PurchasePlanDetailPage() {
<DialogHeader>
<DialogTitle>Добавить канал в план</DialogTitle>
<DialogDescription>
Выберите канал из каталога для добавления в план закупок
Выберите канал из каталога для добавления в план закупов
</DialogDescription>
</DialogHeader>
@@ -723,7 +723,7 @@ export default function PurchasePlanDetailPage() {
<AlertDialogHeader>
<AlertDialogTitle>Удалить канал из плана?</AlertDialogTitle>
<AlertDialogDescription>
Канал "{deletingChannel?.channel.title}" будет удалён из плана закупок.
Канал "{deletingChannel?.channel.title}" будет удалён из плана закупов.
Это действие нельзя отменить.
</AlertDialogDescription>
</AlertDialogHeader>

View File

@@ -116,16 +116,16 @@ export default function PurchasePlansPage() {
<DashboardHeader
breadcrumbs={[
{ label: "Главная", href: `/dashboard/${workspaceId}` },
{ label: "Планы закупок" },
{ label: "Планы закупов" },
]}
/>
<div className="flex flex-1 flex-col gap-4 p-4 pt-0 mt-4">
<div className="flex items-center justify-between">
<div>
<h1 className="text-2xl font-bold tracking-tight">Планы закупок</h1>
<h1 className="text-2xl font-bold tracking-tight">Планы закупов</h1>
<p className="text-muted-foreground">
Управление планами закупок по проектам
Управление планами закупов по проектам
</p>
</div>
</div>
@@ -140,7 +140,7 @@ export default function PurchasePlansPage() {
<ClipboardList className="h-12 w-12 text-muted-foreground mb-4" />
<h3 className="text-lg font-semibold mb-2">Нет проектов</h3>
<p className="text-muted-foreground text-center mb-4">
Добавьте проект через Telegram бота для создания плана закупок
Добавьте проект через Telegram бота для создания плана закупов
</p>
<Button asChild>
<Link href={`/dashboard/${workspaceId}/projects`}>