mirror of
https://github.com/umami-software/umami.git
synced 2026-02-19 20:15:41 +01:00
Card mode for tables.
This commit is contained in:
parent
df3ae72ab7
commit
d9b08d9491
14 changed files with 81 additions and 80 deletions
|
|
@ -1,30 +1,22 @@
|
|||
import { ReactNode } from 'react';
|
||||
import { Icon, DataTable, DataColumn } from '@umami/react-zen';
|
||||
import { Icon, DataTable, DataColumn, DataTableProps } from '@umami/react-zen';
|
||||
import { LinkButton } from '@/components/common/LinkButton';
|
||||
import { useMessages, useNavigation } from '@/components/hooks';
|
||||
import { SquarePen } from '@/components/icons';
|
||||
import { Empty } from '@/components/common/Empty';
|
||||
|
||||
export function WebsitesTable({
|
||||
data = [],
|
||||
showActions,
|
||||
renderLink,
|
||||
}: {
|
||||
data: Record<string, any>[];
|
||||
export interface WebsitesTableProps extends DataTableProps {
|
||||
showActions?: boolean;
|
||||
allowEdit?: boolean;
|
||||
allowView?: boolean;
|
||||
renderLink?: (row: any) => ReactNode;
|
||||
}) {
|
||||
}
|
||||
|
||||
export function WebsitesTable({ showActions, renderLink, ...props }: WebsitesTableProps) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const { renderUrl } = useNavigation();
|
||||
|
||||
if (data.length === 0) {
|
||||
return <Empty />;
|
||||
}
|
||||
|
||||
return (
|
||||
<DataTable data={data}>
|
||||
<DataTable {...props}>
|
||||
<DataColumn id="name" label={formatMessage(labels.name)}>
|
||||
{renderLink}
|
||||
</DataColumn>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue