Updates for cloud mode.
Some checks failed
Node.js CI / build (postgresql, 18.18) (push) Has been cancelled

This commit is contained in:
Mike Cao 2025-09-04 20:27:42 -07:00
parent dc1736458b
commit f40e1b44f3
51 changed files with 251 additions and 173 deletions

View file

@ -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 && (