mirror of
https://github.com/umami-software/umami.git
synced 2026-02-15 01:55:36 +01:00
Updates for cloud mode.
Some checks failed
Node.js CI / build (postgresql, 18.18) (push) Has been cancelled
Some checks failed
Node.js CI / build (postgresql, 18.18) (push) Has been cancelled
This commit is contained in:
parent
dc1736458b
commit
f40e1b44f3
51 changed files with 251 additions and 173 deletions
|
|
@ -3,27 +3,24 @@ import { Row, Text, Icon, DataTable, DataColumn, MenuItem } from '@umami/react-z
|
|||
import { useMessages, useNavigation } from '@/components/hooks';
|
||||
import { MenuButton } from '@/components/input/MenuButton';
|
||||
import { Eye, SquarePen } from '@/components/icons';
|
||||
import Link from 'next/link';
|
||||
|
||||
export interface WebsitesTableProps {
|
||||
data: Record<string, any>[];
|
||||
showActions?: boolean;
|
||||
allowEdit?: boolean;
|
||||
allowView?: boolean;
|
||||
teamId?: string;
|
||||
children?: ReactNode;
|
||||
}
|
||||
|
||||
export function WebsitesTable({
|
||||
data = [],
|
||||
showActions,
|
||||
allowEdit,
|
||||
allowView,
|
||||
renderLink,
|
||||
children,
|
||||
}: WebsitesTableProps) {
|
||||
}: {
|
||||
data: Record<string, any>[];
|
||||
showActions?: boolean;
|
||||
allowEdit?: boolean;
|
||||
allowView?: boolean;
|
||||
renderLink?: (row: any) => ReactNode;
|
||||
children?: ReactNode;
|
||||
}) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const { renderUrl, pathname } = useNavigation();
|
||||
const isSettings = pathname.includes('/settings');
|
||||
const { renderUrl } = useNavigation();
|
||||
|
||||
if (!data?.length) {
|
||||
return children;
|
||||
|
|
@ -32,11 +29,7 @@ export function WebsitesTable({
|
|||
return (
|
||||
<DataTable data={data}>
|
||||
<DataColumn id="name" label={formatMessage(labels.name)}>
|
||||
{(row: any) => (
|
||||
<Link href={renderUrl(`${isSettings ? '/settings' : ''}/websites/${row.id}`, false)}>
|
||||
{row.name}
|
||||
</Link>
|
||||
)}
|
||||
{renderLink}
|
||||
</DataColumn>
|
||||
<DataColumn id="domain" label={formatMessage(labels.domain)} />
|
||||
{showActions && (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue