mirror of
https://github.com/umami-software/umami.git
synced 2026-02-11 08:07:12 +01:00
Link editing.
This commit is contained in:
parent
0558563d35
commit
5f4b83b09c
13 changed files with 123 additions and 89 deletions
|
|
@ -1,16 +1,17 @@
|
|||
import Link from 'next/link';
|
||||
import { DataTable, DataColumn, Row } from '@umami/react-zen';
|
||||
import { useConfig, useMessages, useNavigation } from '@/components/hooks';
|
||||
import { Empty } from '@/components/common/Empty';
|
||||
import { DateDistance } from '@/components/common/DateDistance';
|
||||
import { PixelEditButton } from './PixelEditButton';
|
||||
import { PixelDeleteButton } from './PixelDeleteButton';
|
||||
import Link from 'next/link';
|
||||
import { PIXELS_URL } from '@/lib/constants';
|
||||
|
||||
export function PixelsTable({ data = [] }) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const { websiteId } = useNavigation();
|
||||
const { pixelsUrl } = useConfig();
|
||||
const defaultUrl = `${window.location.origin}/p`;
|
||||
const hostUrl = pixelsUrl || PIXELS_URL;
|
||||
|
||||
if (data.length === 0) {
|
||||
return <Empty />;
|
||||
|
|
@ -21,7 +22,7 @@ export function PixelsTable({ data = [] }) {
|
|||
<DataColumn id="name" label={formatMessage(labels.name)} />
|
||||
<DataColumn id="url" label="URL">
|
||||
{({ slug }: any) => {
|
||||
const url = `${pixelsUrl || defaultUrl}/${slug}`;
|
||||
const url = `${hostUrl}/${slug}`;
|
||||
return <Link href={url}>{url}</Link>;
|
||||
}}
|
||||
</DataColumn>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue