import { CopyButton } from '@/components/CopyButton'; import { type EdgeFunction } from '../services/function.service'; import { cn, getBackendUrl } from '@/lib/utils/utils'; import { format, formatDistance } from 'date-fns'; interface FunctionRowProps { function: EdgeFunction; onClick: () => void; className?: string; } export function FunctionRow({ function: func, onClick, className }: FunctionRowProps) { const functionUrl = `${getBackendUrl()}/functions/${func.slug}`; return (
{/* Name Column */}

{func.name}

{/* URL Column */}
{functionUrl}
{/* Created Column */}
{format(new Date(func.created_at), 'MMM dd, yyyy HH:mm')}
{/* Last Update Column */}
{func.deployed_at ? formatDistance(new Date(func.deployed_at), new Date(), { addSuffix: true }) : 'Never'}
); }