import { clsx } from 'clsx' import styles from './Draft.module.scss' import type { Shout } from '../../graphql/types.gen' import { Icon } from '../_shared/Icon' import { formatDate } from '../../utils' import formatDateTime from '../../utils/formatDateTime' import { useLocalize } from '../../context/localize' import { getPagePath } from '@nanostores/router' import { router } from '../../stores/router' type Props = { class?: string shout: Shout onPublish: (shout: Shout) => void onDelete: (shout: Shout) => void } export const Draft = (props: Props) => { const { t } = useLocalize() const handlePublishLinkClick = (e) => { e.preventDefault() props.onPublish(props.shout) } const handleDeleteLinkClick = (e) => { e.preventDefault() props.onDelete(props.shout) } return (
{formatDate(new Date(props.shout.createdAt))}  {formatDateTime(props.shout.createdAt)()}
{props.shout.title || t('Unnamed draft')} {props.shout.subtitle}
{t('Edit')} {t('Publish')} {t('Delete')}
) }