'use client'; import { ReactNode } from 'react'; import { Text, Icon, Icons, GridTable, GridColumn, useBreakpoint } from 'react-basics'; import { useMessages, useLogin, useTeamUrl } from 'components/hooks'; import LinkButton from 'components/common/LinkButton'; export interface WebsitesTableProps { data: any[]; showActions?: boolean; allowEdit?: boolean; allowView?: boolean; teamId?: string; children?: ReactNode; } export function WebsitesTable({ data = [], showActions, allowEdit, allowView, teamId, children, }: WebsitesTableProps) { const { formatMessage, labels } = useMessages(); const { user } = useLogin(); const breakpoint = useBreakpoint(); const { renderTeamUrl } = useTeamUrl(); return ( {showActions && ( {row => { const { id: websiteId } = row; return ( <> {allowEdit && (teamId || user.isAdmin) && ( {formatMessage(labels.edit)} )} {allowView && ( {formatMessage(labels.view)} )} ); }} )} {children} ); } export default WebsitesTable;