import React from "react" import {chakra, Heading, Image, Text, HStack,Button, Flex,PropsOf,Box, Avatar, VStack, propNames} from "@chakra-ui/react" import { Tag } from "src/types/tag" import { ReserveUrls } from "src/data/reserve-urls" import NextLink from "next/link" import { Story } from "src/types/story" import moment from 'moment' import { FaGithub } from "react-icons/fa" import Link from "next/link" import { useRouter } from "next/router" type Props = PropsOf & { size?: 'lg' | 'md' story : Story showFooter?: boolean } export const StoryAuthor= ({story,showFooter=true,size='lg'}:Props) =>{ const router = useRouter() return ( router.push(`/${story.creator.username}`)} cursor="pointer"/> router.push(`/${story.creator.username}`)} cursor="pointer">{story.creator.nickname === "" ? story.creator.username : story.creator.nickname} 发布于{moment(story.created).fromNow()} {showFooter && 4 min read } ) } export default StoryAuthor