mirror of
https://github.com/umami-software/umami.git
synced 2026-02-05 13:17:19 +01:00
Reformatted files with biome.
This commit is contained in:
parent
d51f0641a6
commit
fa8d8055df
558 changed files with 2108 additions and 2379 deletions
|
|
@ -1,11 +1,11 @@
|
|||
import { useMemo, useState } from 'react';
|
||||
import { useTheme } from '@umami/react-zen';
|
||||
import { useMemo, useState } from 'react';
|
||||
import { Chart, type ChartProps } from '@/components/charts/Chart';
|
||||
import { ChartTooltip } from '@/components/charts/ChartTooltip';
|
||||
import { Chart, ChartProps } from '@/components/charts/Chart';
|
||||
import { useLocale } from '@/components/hooks';
|
||||
import { renderNumberLabels } from '@/lib/charts';
|
||||
import { getThemeColors } from '@/lib/colors';
|
||||
import { formatDate, DATE_FORMATS } from '@/lib/date';
|
||||
import { DATE_FORMATS, formatDate } from '@/lib/date';
|
||||
import { formatLongCurrency, formatLongNumber } from '@/lib/format';
|
||||
|
||||
const dateFormats = {
|
||||
|
|
@ -52,7 +52,7 @@ export function BarChart({
|
|||
|
||||
const chartOptions: any = useMemo(() => {
|
||||
return {
|
||||
__id: new Date().getTime(),
|
||||
__id: Date.now(),
|
||||
scales: {
|
||||
x: {
|
||||
type: XAxisType,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { Chart, ChartProps } from '@/components/charts/Chart';
|
||||
import { useState } from 'react';
|
||||
import { Chart, type ChartProps } from '@/components/charts/Chart';
|
||||
import { ChartTooltip } from '@/components/charts/ChartTooltip';
|
||||
|
||||
export interface BubbleChartProps extends ChartProps {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,11 @@
|
|||
import { useState, useRef, useEffect, useMemo } from 'react';
|
||||
import { Box, Column, BoxProps } from '@umami/react-zen';
|
||||
import ChartJS, { LegendItem, ChartOptions, ChartData, UpdateMode } from 'chart.js/auto';
|
||||
import { Box, type BoxProps, Column } from '@umami/react-zen';
|
||||
import ChartJS, {
|
||||
type ChartData,
|
||||
type ChartOptions,
|
||||
type LegendItem,
|
||||
type UpdateMode,
|
||||
} from 'chart.js/auto';
|
||||
import { useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { Legend } from '@/components/metrics/Legend';
|
||||
import { DEFAULT_ANIMATION_DURATION } from '@/lib/constants';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { ReactNode } from 'react';
|
||||
import { Column, Row, StatusLight, FloatingTooltip } from '@umami/react-zen';
|
||||
import { Column, FloatingTooltip, Row, StatusLight } from '@umami/react-zen';
|
||||
import type { ReactNode } from 'react';
|
||||
|
||||
export function ChartTooltip({
|
||||
title,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { Chart, ChartProps } from '@/components/charts/Chart';
|
||||
import { useState } from 'react';
|
||||
import { Chart, type ChartProps } from '@/components/charts/Chart';
|
||||
import { ChartTooltip } from '@/components/charts/ChartTooltip';
|
||||
|
||||
export interface PieChartProps extends ChartProps {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { Row, Column, Text } from '@umami/react-zen';
|
||||
import { Column, Row, Text } from '@umami/react-zen';
|
||||
|
||||
export function ActionForm({ label, description, children }) {
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import { animated, AnimatedComponent } from '@react-spring/web';
|
||||
import { type AnimatedComponent, animated } from '@react-spring/web';
|
||||
|
||||
export const AnimatedDiv: AnimatedComponent<any> = animated.div;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { useMemo } from 'react';
|
||||
import { createAvatar } from '@dicebear/core';
|
||||
import { lorelei } from '@dicebear/collection';
|
||||
import { createAvatar } from '@dicebear/core';
|
||||
import { useMemo } from 'react';
|
||||
import { getColor, getPastel } from '@/lib/colors';
|
||||
|
||||
const lib = lorelei;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { ReactNode } from 'react';
|
||||
import { Box, Button, FormSubmitButton, Form, FormButtons } from '@umami/react-zen';
|
||||
import { Box, Button, Form, FormButtons, FormSubmitButton } from '@umami/react-zen';
|
||||
import type { ReactNode } from 'react';
|
||||
import { useMessages } from '@/components/hooks';
|
||||
|
||||
export interface ConfirmationFormProps {
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
import type { UseQueryResult } from '@tanstack/react-query';
|
||||
import { Column, Row, SearchField } from '@umami/react-zen';
|
||||
import {
|
||||
ReactNode,
|
||||
useState,
|
||||
useCallback,
|
||||
ReactElement,
|
||||
cloneElement,
|
||||
isValidElement,
|
||||
type ReactElement,
|
||||
type ReactNode,
|
||||
useCallback,
|
||||
useState,
|
||||
} from 'react';
|
||||
import { SearchField, Row, Column } from '@umami/react-zen';
|
||||
import { UseQueryResult } from '@tanstack/react-query';
|
||||
import { useMessages, useMobile, useNavigation } from '@/components/hooks';
|
||||
import { Pager } from '@/components/common/Pager';
|
||||
import { LoadingPanel } from '@/components/common/LoadingPanel';
|
||||
import { PageResult } from '@/lib/types';
|
||||
import { Empty } from '@/components/common/Empty';
|
||||
import { LoadingPanel } from '@/components/common/LoadingPanel';
|
||||
import { Pager } from '@/components/common/Pager';
|
||||
import { useMessages, useMobile, useNavigation } from '@/components/hooks';
|
||||
import type { PageResult } from '@/lib/types';
|
||||
|
||||
const DEFAULT_SEARCH_DELAY = 600;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ export function DateDisplay({ startDate, endDate }) {
|
|||
</Icon>
|
||||
<Text wrap="nowrap">
|
||||
{isSingleDate ? (
|
||||
<>{formatDate(startDate, 'PP', locale)}</>
|
||||
formatDate(startDate, 'PP', locale)
|
||||
) : (
|
||||
<>
|
||||
{formatDate(startDate, 'PP', locale)}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { ReactNode } from 'react';
|
||||
import { Icon, Text, Column } from '@umami/react-zen';
|
||||
import { Column, Icon, Text } from '@umami/react-zen';
|
||||
import type { ReactNode } from 'react';
|
||||
|
||||
export interface EmptyPlaceholderProps {
|
||||
title?: string;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { ErrorInfo, ReactNode } from 'react';
|
||||
import { ErrorBoundary as Boundary } from 'react-error-boundary';
|
||||
import { Button, Column } from '@umami/react-zen';
|
||||
import type { ErrorInfo, ReactNode } from 'react';
|
||||
import { ErrorBoundary as Boundary } from 'react-error-boundary';
|
||||
import { useMessages } from '@/components/hooks';
|
||||
|
||||
const logError = (error: Error, info: ErrorInfo) => {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { Icon, Text, Row } from '@umami/react-zen';
|
||||
import { Icon, Row, Text } from '@umami/react-zen';
|
||||
import { useMessages } from '@/components/hooks';
|
||||
import { AlertTriangle } from '@/components/icons';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import Link from 'next/link';
|
||||
import { Icon, Row, Text } from '@umami/react-zen';
|
||||
import Link from 'next/link';
|
||||
import { ExternalLink as LinkIcon } from '@/components/icons';
|
||||
|
||||
export function ExternalLink({ href, children, ...props }) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { HTMLAttributes, ReactNode, useState } from 'react';
|
||||
import Link from 'next/link';
|
||||
import { Icon, Row, Text } from '@umami/react-zen';
|
||||
import Link from 'next/link';
|
||||
import { type HTMLAttributes, type ReactNode, useState } from 'react';
|
||||
import { useMessages, useNavigation } from '@/components/hooks';
|
||||
import { ExternalLink } from '@/components/icons';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { Button, Column, Grid, Icon, Label, ListItem, Select, TextField } from '@umami/react-zen';
|
||||
import { useState } from 'react';
|
||||
import { Grid, Column, TextField, Label, Select, Icon, Button, ListItem } from '@umami/react-zen';
|
||||
import { Empty } from '@/components/common/Empty';
|
||||
import { useFilters, useFormat, useWebsiteValuesQuery } from '@/components/hooks';
|
||||
import { X } from '@/components/icons';
|
||||
import { isSearchOperator } from '@/lib/params';
|
||||
import { Empty } from '@/components/common/Empty';
|
||||
|
||||
export interface FilterRecordProps {
|
||||
websiteId: string;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { ReactNode } from 'react';
|
||||
import { Button, type ButtonProps } from '@umami/react-zen';
|
||||
import Link from 'next/link';
|
||||
import { Button, ButtonProps } from '@umami/react-zen';
|
||||
import type { ReactNode } from 'react';
|
||||
import { useLocale } from '@/components/hooks';
|
||||
|
||||
export interface LinkButtonProps extends ButtonProps {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { ReactNode } from 'react';
|
||||
import { Loading, Column, type ColumnProps } from '@umami/react-zen';
|
||||
import { ErrorMessage } from '@/components/common/ErrorMessage';
|
||||
import { Column, type ColumnProps, Loading } from '@umami/react-zen';
|
||||
import type { ReactNode } from 'react';
|
||||
import { Empty } from '@/components/common/Empty';
|
||||
import { ErrorMessage } from '@/components/common/ErrorMessage';
|
||||
|
||||
export interface LoadingPanelProps extends ColumnProps {
|
||||
data?: any;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
'use client';
|
||||
import { ReactNode } from 'react';
|
||||
import { AlertBanner, Loading, Column, ColumnProps } from '@umami/react-zen';
|
||||
import { AlertBanner, Column, type ColumnProps, Loading } from '@umami/react-zen';
|
||||
import type { ReactNode } from 'react';
|
||||
import { useMessages } from '@/components/hooks';
|
||||
|
||||
const DEFAULT_WIDTH = '1320px';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { ReactNode } from 'react';
|
||||
import { Heading, Icon, Row, Text, Column, Grid } from '@umami/react-zen';
|
||||
import { Column, Grid, Heading, Icon, Row, Text } from '@umami/react-zen';
|
||||
import type { ReactNode } from 'react';
|
||||
|
||||
export function PageHeader({
|
||||
title,
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
import { useState } from 'react';
|
||||
import {
|
||||
Button,
|
||||
Column,
|
||||
type ColumnProps,
|
||||
Row,
|
||||
Icon,
|
||||
Button,
|
||||
TooltipTrigger,
|
||||
Tooltip,
|
||||
Heading,
|
||||
Icon,
|
||||
Row,
|
||||
Tooltip,
|
||||
TooltipTrigger,
|
||||
} from '@umami/react-zen';
|
||||
import { Maximize, X } from '@/components/icons';
|
||||
import { useState } from 'react';
|
||||
import { useMessages } from '@/components/hooks';
|
||||
import { Maximize, X } from '@/components/icons';
|
||||
|
||||
export interface PanelProps extends ColumnProps {
|
||||
title?: string;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { ReactNode } from 'react';
|
||||
import { Heading, Icon, Row, Text, RowProps } from '@umami/react-zen';
|
||||
import { Heading, Icon, Row, type RowProps, Text } from '@umami/react-zen';
|
||||
import type { ReactNode } from 'react';
|
||||
|
||||
export function SectionHeader({
|
||||
title,
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import {
|
||||
Heading,
|
||||
NavMenu,
|
||||
NavMenuItem,
|
||||
Row,
|
||||
Column,
|
||||
NavMenuGroup,
|
||||
NavMenuProps,
|
||||
Heading,
|
||||
IconLabel,
|
||||
NavMenu,
|
||||
NavMenuGroup,
|
||||
NavMenuItem,
|
||||
type NavMenuProps,
|
||||
Row,
|
||||
} from '@umami/react-zen';
|
||||
import Link from 'next/link';
|
||||
|
||||
|
|
@ -72,6 +72,7 @@ export function SideMenu({
|
|||
</NavMenuGroup>
|
||||
);
|
||||
}
|
||||
return null;
|
||||
})}
|
||||
</NavMenu>
|
||||
</Column>
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ import {
|
|||
Form,
|
||||
FormButtons,
|
||||
FormField,
|
||||
TextField,
|
||||
FormSubmitButton,
|
||||
TextField,
|
||||
} from '@umami/react-zen';
|
||||
import { useMessages } from '@/components/hooks';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { ReactNode } from 'react';
|
||||
import { Row } from '@umami/react-zen';
|
||||
import type { ReactNode } from 'react';
|
||||
|
||||
export function TypeIcon({
|
||||
type,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { LinkContext } from '@/app/(main)/links/LinkProvider';
|
||||
import { useContext } from 'react';
|
||||
import { LinkContext } from '@/app/(main)/links/LinkProvider';
|
||||
|
||||
export function useLink() {
|
||||
return useContext(LinkContext);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { PixelContext } from '@/app/(main)/pixels/PixelProvider';
|
||||
import { useContext } from 'react';
|
||||
import { PixelContext } from '@/app/(main)/pixels/PixelProvider';
|
||||
|
||||
export function usePixel() {
|
||||
return useContext(PixelContext);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { TeamContext } from '@/app/(main)/teams/TeamProvider';
|
||||
import { useContext } from 'react';
|
||||
import { TeamContext } from '@/app/(main)/teams/TeamProvider';
|
||||
|
||||
export function useTeam() {
|
||||
return useContext(TeamContext);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { UserContext } from '@/app/(main)/admin/users/[userId]/UserProvider';
|
||||
import { useContext } from 'react';
|
||||
import { UserContext } from '@/app/(main)/admin/users/[userId]/UserProvider';
|
||||
|
||||
export function useUser() {
|
||||
return useContext(UserContext);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { WebsiteContext } from '@/app/(main)/websites/WebsiteProvider';
|
||||
import { useContext } from 'react';
|
||||
import { WebsiteContext } from '@/app/(main)/websites/WebsiteProvider';
|
||||
|
||||
export function useWebsite() {
|
||||
return useContext(WebsiteContext);
|
||||
|
|
|
|||
|
|
@ -31,13 +31,13 @@ export * from './queries/useSessionDataValuesQuery';
|
|||
export * from './queries/useShareTokenQuery';
|
||||
export * from './queries/useTeamMembersQuery';
|
||||
export * from './queries/useTeamQuery';
|
||||
export * from './queries/useTeamWebsitesQuery';
|
||||
export * from './queries/useTeamsQuery';
|
||||
export * from './queries/useTeamWebsitesQuery';
|
||||
export * from './queries/useUpdateQuery';
|
||||
export * from './queries/useUserQuery';
|
||||
export * from './queries/useUsersQuery';
|
||||
export * from './queries/useUserTeamsQuery';
|
||||
export * from './queries/useUserWebsitesQuery';
|
||||
export * from './queries/useUsersQuery';
|
||||
export * from './queries/useWebsiteCohortQuery';
|
||||
export * from './queries/useWebsiteCohortsQuery';
|
||||
export * from './queries/useWebsiteEventsQuery';
|
||||
|
|
@ -51,10 +51,10 @@ export * from './queries/useWebsiteSegmentsQuery';
|
|||
export * from './queries/useWebsiteSessionQuery';
|
||||
export * from './queries/useWebsiteSessionStatsQuery';
|
||||
export * from './queries/useWebsiteSessionsQuery';
|
||||
export * from './queries/useWeeklyTrafficQuery';
|
||||
export * from './queries/useWebsiteStatsQuery';
|
||||
export * from './queries/useWebsiteValuesQuery';
|
||||
export * from './queries/useWebsitesQuery';
|
||||
export * from './queries/useWebsiteValuesQuery';
|
||||
export * from './queries/useWeeklyTrafficQuery';
|
||||
|
||||
// Regular hooks
|
||||
export * from './useApi';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import type { ReactQueryOptions } from '@/lib/types';
|
||||
import { useApi } from '../useApi';
|
||||
import { ReactQueryOptions } from '@/lib/types';
|
||||
|
||||
export function useActyiveUsersQuery(websiteId: string, options?: ReactQueryOptions) {
|
||||
const { get, useQuery } = useApi();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import type { ReactQueryOptions } from '@/lib/types';
|
||||
import { useApi } from '../useApi';
|
||||
import { ReactQueryOptions } from '@/lib/types';
|
||||
|
||||
type DateRange = {
|
||||
startDate?: string;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import type { ReactQueryOptions } from '@/lib/types';
|
||||
import { useApi } from '../useApi';
|
||||
import { useFilterParameters } from '../useFilterParameters';
|
||||
import { useDateParameters } from '../useDateParameters';
|
||||
import { ReactQueryOptions } from '@/lib/types';
|
||||
import { useFilterParameters } from '../useFilterParameters';
|
||||
|
||||
export function useEventDataEventsQuery(websiteId: string, options?: ReactQueryOptions) {
|
||||
const { get, useQuery } = useApi();
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import type { ReactQueryOptions } from '@/lib/types';
|
||||
import { useApi } from '../useApi';
|
||||
import { useFilterParameters } from '../useFilterParameters';
|
||||
import { useDateParameters } from '../useDateParameters';
|
||||
import { ReactQueryOptions } from '@/lib/types';
|
||||
import { useFilterParameters } from '../useFilterParameters';
|
||||
|
||||
export function useEventDataPropertiesQuery(websiteId: string, options?: ReactQueryOptions) {
|
||||
const { get, useQuery } = useApi();
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import type { ReactQueryOptions } from '@/lib/types';
|
||||
import { useApi } from '../useApi';
|
||||
import { useFilterParameters } from '../useFilterParameters';
|
||||
import { useDateParameters } from '../useDateParameters';
|
||||
import { ReactQueryOptions } from '@/lib/types';
|
||||
import { useFilterParameters } from '../useFilterParameters';
|
||||
|
||||
export function useEventDataQuery(websiteId: string, eventId: string, options?: ReactQueryOptions) {
|
||||
const { get, useQuery } = useApi();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { ReactQueryOptions } from '@/lib/types';
|
||||
import type { ReactQueryOptions } from '@/lib/types';
|
||||
import { useApi } from '../useApi';
|
||||
import { useDateParameters } from '../useDateParameters';
|
||||
import { useFilterParameters } from '../useFilterParameters';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import type { ReactQueryOptions } from '@/lib/types';
|
||||
import { useApi } from '../useApi';
|
||||
import { usePagedQuery } from '../usePagedQuery';
|
||||
import { useModified } from '../useModified';
|
||||
import { ReactQueryOptions } from '@/lib/types';
|
||||
import { usePagedQuery } from '../usePagedQuery';
|
||||
|
||||
export function useLinksQuery({ teamId }: { teamId?: string }, options?: ReactQueryOptions) {
|
||||
const { modified } = useModified('links');
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { useApp, setUser } from '@/store/app';
|
||||
import { setUser, useApp } from '@/store/app';
|
||||
import { useApi } from '../useApi';
|
||||
|
||||
const selector = (state: { user: any }) => state.user;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import type { ReactQueryOptions } from '@/lib/types';
|
||||
import { useApi } from '../useApi';
|
||||
import { usePagedQuery } from '../usePagedQuery';
|
||||
import { useModified } from '../useModified';
|
||||
import { ReactQueryOptions } from '@/lib/types';
|
||||
import { usePagedQuery } from '../usePagedQuery';
|
||||
|
||||
export function usePixelsQuery({ teamId }: { teamId?: string }, options?: ReactQueryOptions) {
|
||||
const { modified } = useModified('pixels');
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { REALTIME_INTERVAL } from '@/lib/constants';
|
||||
import type { RealtimeData } from '@/lib/types';
|
||||
import { useApi } from '../useApi';
|
||||
import { RealtimeData } from '@/lib/types';
|
||||
|
||||
export function useRealtimeQuery(websiteId: string) {
|
||||
const { get, useQuery } = useApi();
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import type { ReactQueryOptions } from '@/lib/types';
|
||||
import { useApi } from '../useApi';
|
||||
import { usePagedQuery } from '../usePagedQuery';
|
||||
import { useModified } from '../useModified';
|
||||
import { ReactQueryOptions } from '@/lib/types';
|
||||
import { usePagedQuery } from '../usePagedQuery';
|
||||
|
||||
export function useReportsQuery(
|
||||
{ websiteId, type }: { websiteId: string; type?: string },
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { useDateParameters } from '@/components/hooks/useDateParameters';
|
||||
import type { ReactQueryOptions } from '@/lib/types';
|
||||
import { useApi } from '../useApi';
|
||||
import { useFilterParameters } from '../useFilterParameters';
|
||||
import { ReactQueryOptions } from '@/lib/types';
|
||||
import { useDateParameters } from '@/components/hooks/useDateParameters';
|
||||
|
||||
export function useResultQuery<T = any>(
|
||||
type: string,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import type { ReactQueryOptions } from '@/lib/types';
|
||||
import { useApi } from '../useApi';
|
||||
import { useFilterParameters } from '../useFilterParameters';
|
||||
import { useDateParameters } from '../useDateParameters';
|
||||
import { ReactQueryOptions } from '@/lib/types';
|
||||
import { useFilterParameters } from '../useFilterParameters';
|
||||
|
||||
export function useSessionDataPropertiesQuery(websiteId: string, options?: ReactQueryOptions) {
|
||||
const { get, useQuery } = useApi();
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import type { ReactQueryOptions } from '@/lib/types';
|
||||
import { useApi } from '../useApi';
|
||||
import { useFilterParameters } from '../useFilterParameters';
|
||||
import { useDateParameters } from '../useDateParameters';
|
||||
import { ReactQueryOptions } from '@/lib/types';
|
||||
import { useFilterParameters } from '../useFilterParameters';
|
||||
|
||||
export function useSessionDataValuesQuery(
|
||||
websiteId: string,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { useApp, setShareToken } from '@/store/app';
|
||||
import { setShareToken, useApp } from '@/store/app';
|
||||
import { useApi } from '../useApi';
|
||||
|
||||
const selector = (state: { shareToken: string }) => state.shareToken;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { useApi } from '../useApi';
|
||||
import { usePagedQuery } from '../usePagedQuery';
|
||||
import { useModified } from '../useModified';
|
||||
import { usePagedQuery } from '../usePagedQuery';
|
||||
|
||||
export function useTeamMembersQuery(teamId: string) {
|
||||
const { get } = useApi();
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { keepPreviousData } from '@tanstack/react-query';
|
||||
import type { ReactQueryOptions } from '@/lib/types';
|
||||
import { useApi } from '../useApi';
|
||||
import { useModified } from '../useModified';
|
||||
import { keepPreviousData } from '@tanstack/react-query';
|
||||
import { ReactQueryOptions } from '@/lib/types';
|
||||
|
||||
export function useTeamQuery(teamId: string, options?: ReactQueryOptions) {
|
||||
const { get, useQuery } = useApi();
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { useApi } from '../useApi';
|
||||
import { usePagedQuery } from '../usePagedQuery';
|
||||
import { useModified } from '../useModified';
|
||||
import { usePagedQuery } from '../usePagedQuery';
|
||||
|
||||
export function useTeamWebsitesQuery(teamId: string) {
|
||||
const { get } = useApi();
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import type { ReactQueryOptions } from '@/lib/types';
|
||||
import { useApi } from '../useApi';
|
||||
import { useModified } from '../useModified';
|
||||
import { usePagedQuery } from '../usePagedQuery';
|
||||
import { ReactQueryOptions } from '@/lib/types';
|
||||
|
||||
export function useTeamsQuery(params?: Record<string, any>, options?: ReactQueryOptions) {
|
||||
const { get } = useApi();
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { keepPreviousData } from '@tanstack/react-query';
|
||||
import type { ReactQueryOptions } from '@/lib/types';
|
||||
import { useApi } from '../useApi';
|
||||
import { useModified } from '../useModified';
|
||||
import { keepPreviousData } from '@tanstack/react-query';
|
||||
import { ReactQueryOptions } from '@/lib/types';
|
||||
|
||||
export function useUserQuery(userId: string, options?: ReactQueryOptions) {
|
||||
const { get, useQuery } = useApi();
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import type { ReactQueryOptions } from '@/lib/types';
|
||||
import { useApi } from '../useApi';
|
||||
import { usePagedQuery } from '../usePagedQuery';
|
||||
import { useModified } from '../useModified';
|
||||
import { ReactQueryOptions } from '@/lib/types';
|
||||
import { usePagedQuery } from '../usePagedQuery';
|
||||
|
||||
export function useUserWebsitesQuery(
|
||||
{ userId, teamId }: { userId?: string; teamId?: string },
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { useApi } from '../useApi';
|
||||
import { usePagedQuery } from '../usePagedQuery';
|
||||
import { useModified } from '../useModified';
|
||||
import { usePagedQuery } from '../usePagedQuery';
|
||||
|
||||
export function useUsersQuery() {
|
||||
const { get } = useApi();
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { keepPreviousData } from '@tanstack/react-query';
|
||||
import type { ReactQueryOptions } from '@/lib/types';
|
||||
import { useApi } from '../useApi';
|
||||
import { useModified } from '../useModified';
|
||||
import { keepPreviousData } from '@tanstack/react-query';
|
||||
import { ReactQueryOptions } from '@/lib/types';
|
||||
|
||||
export function useWebsiteCohortQuery(
|
||||
websiteId: string,
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { keepPreviousData } from '@tanstack/react-query';
|
||||
import { useFilterParameters } from '@/components/hooks/useFilterParameters';
|
||||
import type { ReactQueryOptions } from '@/lib/types';
|
||||
import { useApi } from '../useApi';
|
||||
import { useModified } from '../useModified';
|
||||
import { keepPreviousData } from '@tanstack/react-query';
|
||||
import { ReactQueryOptions } from '@/lib/types';
|
||||
import { useFilterParameters } from '@/components/hooks/useFilterParameters';
|
||||
|
||||
export function useWebsiteCohortsQuery(
|
||||
websiteId: string,
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import type { ReactQueryOptions } from '@/lib/types';
|
||||
import { useApi } from '../useApi';
|
||||
import { useFilterParameters } from '../useFilterParameters';
|
||||
import { useDateParameters } from '../useDateParameters';
|
||||
import { useFilterParameters } from '../useFilterParameters';
|
||||
import { usePagedQuery } from '../usePagedQuery';
|
||||
import { ReactQueryOptions } from '@/lib/types';
|
||||
|
||||
const EVENT_TYPES = {
|
||||
views: 1,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import type { ReactQueryOptions } from '@/lib/types';
|
||||
import { useApi } from '../useApi';
|
||||
import { useFilterParameters } from '../useFilterParameters';
|
||||
import { useDateParameters } from '../useDateParameters';
|
||||
import { ReactQueryOptions } from '@/lib/types';
|
||||
import { useFilterParameters } from '../useFilterParameters';
|
||||
|
||||
export function useWebsiteEventsSeriesQuery(websiteId: string, options?: ReactQueryOptions) {
|
||||
const { get, useQuery } = useApi();
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { keepPreviousData } from '@tanstack/react-query';
|
||||
import type { ReactQueryOptions } from '@/lib/types';
|
||||
import { useApi } from '../useApi';
|
||||
import { useFilterParameters } from '../useFilterParameters';
|
||||
import { useDateParameters } from '../useDateParameters';
|
||||
import { ReactQueryOptions } from '@/lib/types';
|
||||
import { useFilterParameters } from '../useFilterParameters';
|
||||
|
||||
export type WebsiteExpandedMetricsData = {
|
||||
name: string;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { ReactQueryOptions } from '@/lib/types';
|
||||
import { keepPreviousData } from '@tanstack/react-query';
|
||||
import type { ReactQueryOptions } from '@/lib/types';
|
||||
import { useApi } from '../useApi';
|
||||
import { useDateParameters } from '../useDateParameters';
|
||||
import { useFilterParameters } from '../useFilterParameters';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import type { ReactQueryOptions } from '@/lib/types';
|
||||
import { useApi } from '../useApi';
|
||||
import { useFilterParameters } from '../useFilterParameters';
|
||||
import { useDateParameters } from '../useDateParameters';
|
||||
import { ReactQueryOptions } from '@/lib/types';
|
||||
import { useFilterParameters } from '../useFilterParameters';
|
||||
|
||||
export interface WebsitePageviewsData {
|
||||
pageviews: { x: string; y: number }[];
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { keepPreviousData } from '@tanstack/react-query';
|
||||
import type { ReactQueryOptions } from '@/lib/types';
|
||||
import { useApi } from '../useApi';
|
||||
import { useModified } from '../useModified';
|
||||
import { keepPreviousData } from '@tanstack/react-query';
|
||||
import { ReactQueryOptions } from '@/lib/types';
|
||||
|
||||
export function useWebsiteQuery(websiteId: string, options?: ReactQueryOptions) {
|
||||
const { get, useQuery } = useApi();
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { keepPreviousData } from '@tanstack/react-query';
|
||||
import type { ReactQueryOptions } from '@/lib/types';
|
||||
import { useApi } from '../useApi';
|
||||
import { useModified } from '../useModified';
|
||||
import { keepPreviousData } from '@tanstack/react-query';
|
||||
import { ReactQueryOptions } from '@/lib/types';
|
||||
|
||||
export function useWebsiteSegmentQuery(
|
||||
websiteId: string,
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { keepPreviousData } from '@tanstack/react-query';
|
||||
import { useFilterParameters } from '@/components/hooks/useFilterParameters';
|
||||
import type { ReactQueryOptions } from '@/lib/types';
|
||||
import { useApi } from '../useApi';
|
||||
import { useModified } from '../useModified';
|
||||
import { keepPreviousData } from '@tanstack/react-query';
|
||||
import { ReactQueryOptions } from '@/lib/types';
|
||||
import { useFilterParameters } from '@/components/hooks/useFilterParameters';
|
||||
|
||||
export function useWebsiteSegmentsQuery(
|
||||
websiteId: string,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { useApi } from '../useApi';
|
||||
import { useFilterParameters } from '../useFilterParameters';
|
||||
import { useDateParameters } from '../useDateParameters';
|
||||
import { useFilterParameters } from '../useFilterParameters';
|
||||
|
||||
export function useWebsiteSessionStatsQuery(websiteId: string, options?: Record<string, string>) {
|
||||
const { get, useQuery } = useApi();
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { UseQueryOptions } from '@tanstack/react-query';
|
||||
import type { UseQueryOptions } from '@tanstack/react-query';
|
||||
import { useDateParameters } from '@/components/hooks/useDateParameters';
|
||||
import { useApi } from '../useApi';
|
||||
import { useFilterParameters } from '../useFilterParameters';
|
||||
import { useDateParameters } from '@/components/hooks/useDateParameters';
|
||||
|
||||
export interface WebsiteStatsData {
|
||||
pageviews: number;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { useApi } from '../useApi';
|
||||
import { useCountryNames } from '@/components/hooks/useCountryNames';
|
||||
import { useRegionNames } from '@/components/hooks/useRegionNames';
|
||||
import { useApi } from '../useApi';
|
||||
import { useLocale } from '../useLocale';
|
||||
|
||||
export function useWebsiteValuesQuery({
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import type { ReactQueryOptions } from '@/lib/types';
|
||||
import { useApi } from '../useApi';
|
||||
import { usePagedQuery } from '../usePagedQuery';
|
||||
import { useModified } from '../useModified';
|
||||
import { ReactQueryOptions } from '@/lib/types';
|
||||
import { usePagedQuery } from '../usePagedQuery';
|
||||
|
||||
export function useWebsitesQuery(params?: Record<string, any>, options?: ReactQueryOptions) {
|
||||
const { get } = useApi();
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { useApi } from '../useApi';
|
||||
import { useModified } from '../useModified';
|
||||
import { useDateParameters } from '../useDateParameters';
|
||||
import { useFilterParameters } from '@/components/hooks/useFilterParameters';
|
||||
import { useApi } from '../useApi';
|
||||
import { useDateParameters } from '../useDateParameters';
|
||||
import { useModified } from '../useModified';
|
||||
|
||||
export function useWeeklyTrafficQuery(websiteId: string, params?: Record<string, string | number>) {
|
||||
const { get, useQuery } = useApi();
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { useMutation, useQuery } from '@tanstack/react-query';
|
||||
import { useCallback } from 'react';
|
||||
import { useQuery, useMutation } from '@tanstack/react-query';
|
||||
import { getClientAuthToken } from '@/lib/client';
|
||||
import { SHARE_TOKEN_HEADER } from '@/lib/constants';
|
||||
import { httpGet, httpPost, httpPut, httpDelete, FetchResponse } from '@/lib/fetch';
|
||||
import { type FetchResponse, httpDelete, httpGet, httpPost, httpPut } from '@/lib/fetch';
|
||||
import { useApp } from '@/store/app';
|
||||
|
||||
const selector = (state: { shareToken: { token?: string } }) => state.shareToken;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { useEffect } from 'react';
|
||||
import { useApp, setConfig } from '@/store/app';
|
||||
import { useApi } from '@/components/hooks/useApi';
|
||||
import { setConfig, useApp } from '@/store/app';
|
||||
|
||||
export type Config = {
|
||||
cloudMode: boolean;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { useState, useEffect } from 'react';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { httpGet } from '@/lib/fetch';
|
||||
import enUS from '../../../public/intl/country/en-US.json';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { useNavigation } from '@/components/hooks/useNavigation';
|
||||
import { useMemo } from 'react';
|
||||
import { getCompareDate, getOffsetDateRange, parseDateRange } from '@/lib/date';
|
||||
import { useLocale } from '@/components/hooks/useLocale';
|
||||
import { useNavigation } from '@/components/hooks/useNavigation';
|
||||
import { DATE_RANGE_CONFIG, DEFAULT_DATE_RANGE_VALUE } from '@/lib/constants';
|
||||
import { getCompareDate, getOffsetDateRange, parseDateRange } from '@/lib/date';
|
||||
import { getItem } from '@/lib/storage';
|
||||
|
||||
export function useDateRange(options: { ignoreOffset?: boolean; timezone?: string } = {}) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { useEffect, useCallback, KeyboardEvent } from 'react';
|
||||
import { type KeyboardEvent, useCallback, useEffect } from 'react';
|
||||
|
||||
export function useEscapeKey(handler: (event: KeyboardEvent) => void) {
|
||||
const escFunction = useCallback((event: KeyboardEvent) => {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { FILTER_COLUMNS, OPERATORS } from '@/lib/constants';
|
||||
import { safeDecodeURIComponent } from '@/lib/url';
|
||||
import { useFields } from './useFields';
|
||||
import { useMessages } from './useMessages';
|
||||
import { useNavigation } from './useNavigation';
|
||||
import { useFields } from './useFields';
|
||||
|
||||
export function useFilters() {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { useMessages } from './useMessages';
|
||||
import { BROWSERS, OS_NAMES } from '@/lib/constants';
|
||||
import { useLocale } from './useLocale';
|
||||
import regions from '../../../public/iso-3166-2.json';
|
||||
import { useCountryNames } from './useCountryNames';
|
||||
import { useLanguageNames } from './useLanguageNames';
|
||||
import regions from '../../../public/iso-3166-2.json';
|
||||
import { useLocale } from './useLocale';
|
||||
import { useMessages } from './useMessages';
|
||||
|
||||
export function useFormat() {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { useState, useEffect } from 'react';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { httpGet } from '@/lib/fetch';
|
||||
import enUS from '../../../public/intl/language/en-US.json';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import { useEffect } from 'react';
|
||||
import { httpGet } from '@/lib/fetch';
|
||||
import { setItem } from '@/lib/storage';
|
||||
import { LOCALE_CONFIG } from '@/lib/constants';
|
||||
import { httpGet } from '@/lib/fetch';
|
||||
import { getDateLocale, getTextDirection } from '@/lib/lang';
|
||||
import { useApp, setLocale } from '@/store/app';
|
||||
import { useForceUpdate } from './useForceUpdate';
|
||||
import { setItem } from '@/lib/storage';
|
||||
import { setLocale, useApp } from '@/store/app';
|
||||
import enUS from '../../../public/intl/country/en-US.json';
|
||||
import { useForceUpdate } from './useForceUpdate';
|
||||
|
||||
const messages = {
|
||||
'en-US': enUS,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { useIntl, FormattedMessage, type MessageDescriptor } from 'react-intl';
|
||||
import { messages, labels } from '@/components/messages';
|
||||
import { FormattedMessage, type MessageDescriptor, useIntl } from 'react-intl';
|
||||
import { labels, messages } from '@/components/messages';
|
||||
|
||||
type FormatMessage = (
|
||||
descriptor: MessageDescriptor,
|
||||
|
|
@ -30,9 +30,9 @@ export function useMessages(): UseMessages {
|
|||
return undefined;
|
||||
}
|
||||
|
||||
const code = error?.['code'];
|
||||
const code = error?.code;
|
||||
|
||||
return code ? getMessage(code) : error?.['message'] || 'Unknown error';
|
||||
return code ? getMessage(code) : error?.message || 'Unknown error';
|
||||
};
|
||||
|
||||
const formatMessage = (
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { useState, useEffect } from 'react';
|
||||
import { usePathname, useRouter, useSearchParams } from 'next/navigation';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { buildPath } from '@/lib/url';
|
||||
|
||||
export function useNavigation() {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { UseQueryOptions, UseQueryResult } from '@tanstack/react-query';
|
||||
import type { UseQueryOptions, UseQueryResult } from '@tanstack/react-query';
|
||||
import type { PageResult } from '@/lib/types';
|
||||
import { useApi } from './useApi';
|
||||
import { useNavigation } from './useNavigation';
|
||||
import { PageResult } from '@/lib/types';
|
||||
|
||||
export function usePagedQuery<TData = any, TError = Error>({
|
||||
queryKey,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { useCountryNames } from './useCountryNames';
|
||||
import regions from '../../../public/iso-3166-2.json';
|
||||
import { useCountryNames } from './useCountryNames';
|
||||
|
||||
export function useRegionNames(locale: string) {
|
||||
const { countryNames } = useCountryNames(locale);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { useState, useEffect, useRef } from 'react';
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
|
||||
export function useSticky({ enabled = true, threshold = 1 }) {
|
||||
const [isSticky, setIsSticky] = useState(false);
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { setItem } from '@/lib/storage';
|
||||
import { formatInTimeZone, utcToZonedTime, zonedTimeToUtc } from 'date-fns-tz';
|
||||
import { TIMEZONE_CONFIG, TIMEZONE_LEGACY } from '@/lib/constants';
|
||||
import { formatInTimeZone, zonedTimeToUtc, utcToZonedTime } from 'date-fns-tz';
|
||||
import { useApp, setTimezone } from '@/store/app';
|
||||
import { useLocale } from './useLocale';
|
||||
import { getTimezone } from '@/lib/date';
|
||||
import { setItem } from '@/lib/storage';
|
||||
import { setTimezone, useApp } from '@/store/app';
|
||||
import { useLocale } from './useLocale';
|
||||
|
||||
const selector = (state: { timezone: string }) => state.timezone;
|
||||
|
||||
|
|
@ -21,7 +21,7 @@ export function useTimezone() {
|
|||
return formatInTimeZone(
|
||||
/^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{3})?Z$/.test(date)
|
||||
? date
|
||||
: date.split(' ').join('T') + 'Z',
|
||||
: `${date.split(' ').join('T')}Z`,
|
||||
timezone,
|
||||
pattern,
|
||||
{ locale: dateLocale },
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { Select, ListItem } from '@umami/react-zen';
|
||||
import { ListItem, Select } from '@umami/react-zen';
|
||||
import { useMessages } from '@/components/hooks';
|
||||
|
||||
export interface ActionSelectProps {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { CURRENCIES } from '@/lib/constants';
|
||||
import { ListItem, Select } from '@umami/react-zen';
|
||||
import { useState } from 'react';
|
||||
import { useMessages } from '@/components/hooks';
|
||||
import { CURRENCIES } from '@/lib/constants';
|
||||
|
||||
export function CurrencySelect({ value, onChange }) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { useState, Key, Fragment } from 'react';
|
||||
import { Modal, Select, ListItem, ListSeparator, Dialog, SelectProps } from '@umami/react-zen';
|
||||
import { Dialog, ListItem, ListSeparator, Modal, Select, type SelectProps } from '@umami/react-zen';
|
||||
import { endOfYear } from 'date-fns';
|
||||
import { DatePickerForm } from '@/components/metrics/DatePickerForm';
|
||||
import { useMessages, useMobile } from '@/components/hooks';
|
||||
import { Fragment, type Key, useState } from 'react';
|
||||
import { DateDisplay } from '@/components/common/DateDisplay';
|
||||
import { useMessages, useMobile } from '@/components/hooks';
|
||||
import { DatePickerForm } from '@/components/metrics/DatePickerForm';
|
||||
import { parseDateRange } from '@/lib/date';
|
||||
|
||||
export interface DateFilterProps extends SelectProps {
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import { CSSProperties, ReactNode } from 'react';
|
||||
import {
|
||||
Button,
|
||||
ButtonProps,
|
||||
Modal,
|
||||
type ButtonProps,
|
||||
Dialog,
|
||||
type DialogProps,
|
||||
DialogTrigger,
|
||||
DialogProps,
|
||||
IconLabel,
|
||||
Modal,
|
||||
} from '@umami/react-zen';
|
||||
import type { CSSProperties, ReactNode } from 'react';
|
||||
import { useMobile } from '@/components/hooks';
|
||||
|
||||
export interface DialogButtonProps extends Omit<ButtonProps, 'children'> {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Button, Icon, Tooltip, TooltipTrigger } from '@umami/react-zen';
|
||||
import Papa from 'papaparse';
|
||||
import { Button, Icon, TooltipTrigger, Tooltip } from '@umami/react-zen';
|
||||
import { Download } from '@/components/icons';
|
||||
import { useMessages } from '@/components/hooks';
|
||||
import { Download } from '@/components/icons';
|
||||
|
||||
export function DownloadButton({
|
||||
filename = 'data',
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { useState } from 'react';
|
||||
import { Icon, Tooltip, TooltipTrigger, LoadingButton } from '@umami/react-zen';
|
||||
import { Download } from '@/components/icons';
|
||||
import { useMessages, useApi } from '@/components/hooks';
|
||||
import { Icon, LoadingButton, Tooltip, TooltipTrigger } from '@umami/react-zen';
|
||||
import { useSearchParams } from 'next/navigation';
|
||||
import { useState } from 'react';
|
||||
import { useApi, useMessages } from '@/components/hooks';
|
||||
import { useDateParameters } from '@/components/hooks/useDateParameters';
|
||||
import { useFilterParameters } from '@/components/hooks/useFilterParameters';
|
||||
import { Download } from '@/components/icons';
|
||||
|
||||
export function ExportButton({ websiteId }: { websiteId: string }) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
|
|
|
|||
|
|
@ -1,22 +1,22 @@
|
|||
import { Key } from 'react';
|
||||
import { subMonths, endOfDay } from 'date-fns';
|
||||
import {
|
||||
Grid,
|
||||
Button,
|
||||
Column,
|
||||
Grid,
|
||||
Icon,
|
||||
List,
|
||||
ListItem,
|
||||
Row,
|
||||
Button,
|
||||
Popover,
|
||||
MenuTrigger,
|
||||
Menu,
|
||||
MenuItem,
|
||||
Icon,
|
||||
MenuTrigger,
|
||||
Popover,
|
||||
Row,
|
||||
} from '@umami/react-zen';
|
||||
import { endOfDay, subMonths } from 'date-fns';
|
||||
import type { Key } from 'react';
|
||||
import { Empty } from '@/components/common/Empty';
|
||||
import { FilterRecord } from '@/components/common/FilterRecord';
|
||||
import { useFields, useMessages, useMobile } from '@/components/hooks';
|
||||
import { Plus } from '@/components/icons';
|
||||
import { FilterRecord } from '@/components/common/FilterRecord';
|
||||
import { Empty } from '@/components/common/Empty';
|
||||
|
||||
export interface FieldFiltersProps {
|
||||
websiteId: string;
|
||||
|
|
|
|||
|
|
@ -1,24 +1,24 @@
|
|||
import {
|
||||
Button,
|
||||
Icon,
|
||||
Text,
|
||||
Row,
|
||||
TooltipTrigger,
|
||||
Tooltip,
|
||||
Modal,
|
||||
Dialog,
|
||||
DialogTrigger,
|
||||
Icon,
|
||||
Modal,
|
||||
Row,
|
||||
Text,
|
||||
Tooltip,
|
||||
TooltipTrigger,
|
||||
} from '@umami/react-zen';
|
||||
import { SegmentEditForm } from '@/app/(main)/websites/[websiteId]/segments/SegmentEditForm';
|
||||
import {
|
||||
useNavigation,
|
||||
useMessages,
|
||||
useFormat,
|
||||
useFilters,
|
||||
useFormat,
|
||||
useMessages,
|
||||
useNavigation,
|
||||
useWebsiteSegmentQuery,
|
||||
} from '@/components/hooks';
|
||||
import { X, Bookmark } from '@/components/icons';
|
||||
import { Bookmark, X } from '@/components/icons';
|
||||
import { isSearchOperator } from '@/lib/params';
|
||||
import { SegmentEditForm } from '@/app/(main)/websites/[websiteId]/segments/SegmentEditForm';
|
||||
|
||||
export function FilterBar({ websiteId }: { websiteId: string }) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { Box, ToggleGroup, ToggleGroupItem } from '@umami/react-zen';
|
||||
import { useState } from 'react';
|
||||
import { ToggleGroup, ToggleGroupItem, Box } from '@umami/react-zen';
|
||||
|
||||
export interface FilterButtonsProps {
|
||||
items: { id: string; label: string }[];
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { Button, Column, Row, Tab, TabList, TabPanel, Tabs } from '@umami/react-zen';
|
||||
import { useState } from 'react';
|
||||
import { useFilters, useMessages, useMobile, useNavigation } from '@/components/hooks';
|
||||
import { FieldFilters } from '@/components/input/FieldFilters';
|
||||
import { SegmentFilters } from '@/components/input/SegmentFilters';
|
||||
import { Button, Column, Row, Tab, TabList, TabPanel, Tabs } from '@umami/react-zen';
|
||||
import { useState } from 'react';
|
||||
|
||||
export interface FilterEditFormProps {
|
||||
websiteId?: string;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Icon, Button, MenuTrigger, Popover, Grid, Text, Dialog } from '@umami/react-zen';
|
||||
import { languages } from '@/lib/lang';
|
||||
import { useLocale } from '@/components/hooks';
|
||||
import { Button, Dialog, Grid, Icon, MenuTrigger, Popover, Text } from '@umami/react-zen';
|
||||
import { Globe } from 'lucide-react';
|
||||
import { useLocale } from '@/components/hooks';
|
||||
import { languages } from '@/lib/lang';
|
||||
|
||||
export function LanguageButton() {
|
||||
const { locale, saveLocale } = useLocale();
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { SetStateAction, useMemo, useState } from 'react';
|
||||
import { ComboBox, type ComboBoxProps, ListItem, Loading, useDebounce } from '@umami/react-zen';
|
||||
import { endOfDay, subMonths } from 'date-fns';
|
||||
import { ComboBox, ListItem, Loading, useDebounce, ComboBoxProps } from '@umami/react-zen';
|
||||
import { type SetStateAction, useMemo, useState } from 'react';
|
||||
import { Empty } from '@/components/common/Empty';
|
||||
import { useMessages, useWebsiteValuesQuery } from '@/components/hooks';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { ReactNode, Key } from 'react';
|
||||
import { DialogTrigger, Button, Menu, Popover, Icon } from '@umami/react-zen';
|
||||
import { Button, DialogTrigger, Icon, Menu, Popover } from '@umami/react-zen';
|
||||
import type { Key, ReactNode } from 'react';
|
||||
import { Ellipsis } from '@/components/icons';
|
||||
|
||||
export function MenuButton({
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { Dialog, DialogTrigger, Button, Icon, Modal, DialogProps } from '@umami/react-zen';
|
||||
import { Button, Dialog, type DialogProps, DialogTrigger, Icon, Modal } from '@umami/react-zen';
|
||||
import { Menu } from '@/components/icons';
|
||||
|
||||
export function MobileMenuButton(props: DialogProps) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { Row, Select, ListItem } from '@umami/react-zen';
|
||||
import { ListItem, Row, Select } from '@umami/react-zen';
|
||||
import { useLocale } from '@/components/hooks';
|
||||
import { formatDate } from '@/lib/date';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,18 +1,19 @@
|
|||
import {
|
||||
Text,
|
||||
Column,
|
||||
Icon,
|
||||
IconLabel,
|
||||
Menu,
|
||||
MenuItem,
|
||||
MenuTrigger,
|
||||
MenuSection,
|
||||
MenuSeparator,
|
||||
SubmenuTrigger,
|
||||
MenuTrigger,
|
||||
Popover,
|
||||
Row,
|
||||
Column,
|
||||
Pressable,
|
||||
IconLabel,
|
||||
Row,
|
||||
SubmenuTrigger,
|
||||
Text,
|
||||
} from '@umami/react-zen';
|
||||
import { ArrowRight } from 'lucide-react';
|
||||
import {
|
||||
useConfig,
|
||||
useLoginQuery,
|
||||
|
|
@ -33,7 +34,6 @@ import {
|
|||
} from '@/components/icons';
|
||||
import { Switch } from '@/components/svg';
|
||||
import { DOCS_URL } from '@/lib/constants';
|
||||
import { ArrowRight } from 'lucide-react';
|
||||
|
||||
export interface TeamsButtonProps {
|
||||
showText?: boolean;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue