personal-website/components/List.tsx

14 lines
276 B
TypeScript
Raw Normal View History

import { FC, PropsWithChildren } from 'react'
export interface Props {
type: `${'un' | ''}ordered`
}
const List: FC<PropsWithChildren<Props>> = ({ type, children }) => {
const Tag = type === 'ordered' ? 'ol' : 'ul'
return <Tag>{children}</Tag>
}
export default List