import React from 'react'
import Link from 'next/link'
import _ from 'lodash'
import C from '~/code/classes'
type TitleProps = {
author?: string
back?: string
date?: string
id?: string
tab?: React.ReactNode
tag?: React.ReactNode
title: React.ReactNode
type?: string
url: string
textFill?: string
fontSize?: number
}
type HeaderProps = {
children: React.ReactNode
}
function Header({ children }: HeaderProps) {
const list = [C.widthMax720, C.textCenter]
return
}
type DateProps = {
children: React.ReactNode
}
function Date({ children }: DateProps) {
const list = [C.font12, C.lineHeight1P7, C.textCenter]
return
{children}
}
type AuthorProps = {
children: React.ReactNode
}
function Author({ children }: AuthorProps) {
const list = [
C.font16,
C.lineHeight1P7,
C.marginBottom8,
C.marginTop8,
C.textCenter,
]
return {children}
}
type TagContainerProps = {
children: React.ReactNode
}
function TagContainer({ children }: TagContainerProps) {
const list = [C.paddingTop16]
return {children}
}
type SmallProps = {
children: React.ReactNode
}
function Small({ children }: SmallProps) {
const list = [C.displayBlock, C.font24]
return {children}
}
type H1Props = {
children: React.ReactNode
textFill?: string
}
function H1({ children, textFill }: H1Props) {
const list = [
C.font32,
C.marginBottom32,
C.marginTop32,
C.paddingLr16,
getTextClass(textFill),
// C.lowercase,
]
return {children}
}
type TextProps = {
children: React.ReactNode
textFill?: string
fontSize?: number
}
function Text({ children, textFill, fontSize }: TextProps) {
const list = [
C.font32,
C.fontNotoSans,
C.lineHeight1P7,
getTextClass(textFill),
]
return (
{children}
)
}
function getTextClass(fill?: string) {
return fill
? fill === 'light'
? C.textFillLight
: C.textFillDark
: C.textFillBaseContrast
}
Title.Small = Small
export default function Title({
title,
tab,
url,
date,
author,
tag,
textFill,
fontSize,
}: TitleProps) {
return (
{title ?? tab}
{author && by {author}}
{date && c. {date}}
{tag && {tag}}
)
}