// Theirs import React from 'react' import Link from 'next/link' import Router from 'next/router' import formatDistanceToNow from 'date-fns/formatDistanceToNow' import { useAsyncCallback } from '@dawnlabs/tacklebox' import Button from '../components/Button' import LoginButton from '../components/LoginButton' import { useAuth } from '../components/AuthContext' import { useAPI } from '../components/ApiContext' import { MetaLinks } from '../components/Meta' import Carbon from '../components/Carbon' import { COLORS, DEFAULT_SETTINGS } from '../lib/constants' // Ours import Page from '../components/Page' function correctTimestamp(n) { if (n < 9e12) { return n * 1000 } return n } function Snippet(props) { const config = { ...DEFAULT_SETTINGS, ...props, fontSize: '2px', windowControls: false } return (
{props.code}
{props.title || props.id}
Edited {formatDistanceToNow(correctTimestamp(props.updatedAt), { addSuffix: true })}
) } function ActionButton(props) { return (