import { ReactNode } from 'react'; import { Row, Text, Icon, DataTable, DataColumn, MenuItem } from '@umami/react-zen'; 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[]; showActions?: boolean; allowEdit?: boolean; allowView?: boolean; teamId?: string; children?: ReactNode; } export function WebsitesTable({ data = [], showActions, allowEdit, allowView, children, }: WebsitesTableProps) { const { formatMessage, labels } = useMessages(); const { renderUrl, pathname } = useNavigation(); const isSettings = pathname.includes('/settings'); if (!data?.length) { return children; } return ( {(row: any) => ( {row.name} )} {showActions && ( {(row: any) => { const websiteId = row.id; return ( {allowView && ( {formatMessage(labels.view)} )} {allowEdit && ( {formatMessage(labels.edit)} )} ); }} )} ); }