feat: projects selector replace
This commit is contained in:
@@ -16,6 +16,7 @@ import {
|
||||
import { DashboardHeader } from "@/components/layout/dashboard-header";
|
||||
import { useWorkspace } from "@/components/providers/workspace-provider";
|
||||
import { demoAwareAnalyticsApi } from "@/lib/demo";
|
||||
import { ProjectSelector } from "@/components/project-selector";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
@@ -169,13 +170,16 @@ export default function ChannelsAnalyticsPage() {
|
||||
/>
|
||||
|
||||
<div className="flex flex-1 flex-col gap-4 p-4 pt-0 mt-4">
|
||||
<div>
|
||||
<h1 className="text-2xl font-bold tracking-tight">
|
||||
Аналитика по каналам
|
||||
</h1>
|
||||
<p className="text-muted-foreground">
|
||||
Эффективность каналов размещения
|
||||
</p>
|
||||
<div className="flex items-center justify-between">
|
||||
<div>
|
||||
<h1 className="text-2xl font-bold tracking-tight">
|
||||
Аналитика по каналам
|
||||
</h1>
|
||||
<p className="text-muted-foreground">
|
||||
Эффективность каналов размещения
|
||||
</p>
|
||||
</div>
|
||||
<ProjectSelector />
|
||||
</div>
|
||||
|
||||
{loading ? (
|
||||
|
||||
@@ -17,6 +17,7 @@ import {
|
||||
import { DashboardHeader } from "@/components/layout/dashboard-header";
|
||||
import { useWorkspace } from "@/components/providers/workspace-provider";
|
||||
import { demoAwareAnalyticsApi } from "@/lib/demo";
|
||||
import { ProjectSelector } from "@/components/project-selector";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
@@ -189,13 +190,16 @@ export default function CreativesAnalyticsPage() {
|
||||
/>
|
||||
|
||||
<div className="flex flex-1 flex-col gap-4 p-4 pt-0 mt-4">
|
||||
<div>
|
||||
<h1 className="text-2xl font-bold tracking-tight">
|
||||
Аналитика по креативам
|
||||
</h1>
|
||||
<p className="text-muted-foreground">
|
||||
Сравнение эффективности рекламных материалов
|
||||
</p>
|
||||
<div className="flex items-center justify-between">
|
||||
<div>
|
||||
<h1 className="text-2xl font-bold tracking-tight">
|
||||
Аналитика по креативам
|
||||
</h1>
|
||||
<p className="text-muted-foreground">
|
||||
Сравнение эффективности рекламных материалов
|
||||
</p>
|
||||
</div>
|
||||
<ProjectSelector />
|
||||
</div>
|
||||
|
||||
{loading ? (
|
||||
|
||||
@@ -19,6 +19,7 @@ import {
|
||||
import { DashboardHeader } from "@/components/layout/dashboard-header";
|
||||
import { useWorkspace } from "@/components/providers/workspace-provider";
|
||||
import { demoAwareAnalyticsApi } from "@/lib/demo";
|
||||
import { ProjectSelector } from "@/components/project-selector";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
@@ -26,7 +27,6 @@ import {
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Alert, AlertDescription } from "@/components/ui/alert";
|
||||
import type { SpendingAnalytics } from "@/lib/types/api";
|
||||
|
||||
@@ -97,13 +97,6 @@ export default function AnalyticsPage() {
|
||||
? (spending.total_cost / spending.total_views) * 1000
|
||||
: null;
|
||||
|
||||
// Selection info text
|
||||
const selectionText = allProjectsSelected
|
||||
? "Все проекты"
|
||||
: selectedProjects.length === 1
|
||||
? selectedProjects[0].title
|
||||
: `${selectedProjects.length} проекта`;
|
||||
|
||||
return (
|
||||
<>
|
||||
<DashboardHeader
|
||||
@@ -121,9 +114,7 @@ export default function AnalyticsPage() {
|
||||
Обзор эффективности рекламных размещений
|
||||
</p>
|
||||
</div>
|
||||
<Badge variant="outline" className="text-sm">
|
||||
{selectionText}
|
||||
</Badge>
|
||||
<ProjectSelector />
|
||||
</div>
|
||||
|
||||
{selectedProjects.length > 1 && !allProjectsSelected && (
|
||||
|
||||
@@ -20,6 +20,7 @@ import {
|
||||
import { DashboardHeader } from "@/components/layout/dashboard-header";
|
||||
import { useWorkspace } from "@/components/providers/workspace-provider";
|
||||
import { demoAwareAnalyticsApi } from "@/lib/demo";
|
||||
import { ProjectSelector } from "@/components/project-selector";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
@@ -288,16 +289,19 @@ export default function SpendingAnalyticsPage() {
|
||||
<h1 className="text-2xl font-bold tracking-tight">Динамика расходов</h1>
|
||||
<p className="text-muted-foreground">Анализ расходов по периодам</p>
|
||||
</div>
|
||||
<Select value={grouping} onValueChange={(v) => setGrouping(v as DateGrouping)}>
|
||||
<SelectTrigger className="w-[180px]">
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="day">По дням</SelectItem>
|
||||
<SelectItem value="week">По неделям</SelectItem>
|
||||
<SelectItem value="month">По месяцам</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<div className="flex items-center gap-2">
|
||||
<ProjectSelector />
|
||||
<Select value={grouping} onValueChange={(v) => setGrouping(v as DateGrouping)}>
|
||||
<SelectTrigger className="w-[180px]">
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="day">По дням</SelectItem>
|
||||
<SelectItem value="week">По неделям</SelectItem>
|
||||
<SelectItem value="month">По месяцам</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{loading ? (
|
||||
|
||||
Reference in New Issue
Block a user