// Theirs import React from 'react' import Link from 'next/link' import Router from 'next/router' import formatDistanceToNow from 'date-fns/formatDistanceToNow' import { useAsyncCallback } from 'actionsack' import Button from '../components/Button' import LoginButton from '../components/LoginButton' import ConfirmButton from '../components/ConfirmButton' import { MetaLinks } from '../components/Meta' import Carbon from '../components/Carbon' import Page from '../components/Page' import { useAuth } from '../components/AuthContext' import { useAPI } from '../components/ApiContext' import { COLORS, DEFAULT_SETTINGS } from '../lib/constants' 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.name || props.title || props.id}
Edited {formatDistanceToNow(correctTimestamp(props.updatedAt), { addSuffix: true })}
Delete
) } function ActionButton(props) { return (