mirror of
https://github.com/kremalicious/blog.git
synced 2024-06-30 13:41:54 +02:00
33 lines
541 B
TypeScript
33 lines
541 B
TypeScript
|
import type { ReactElement } from 'react'
|
||
|
import { Flag } from './Flag'
|
||
|
|
||
|
type LocationProps = {
|
||
|
country: string
|
||
|
countryCode: string
|
||
|
city: string
|
||
|
time: string
|
||
|
showFlag?: boolean
|
||
|
}
|
||
|
|
||
|
export function LocationItem({
|
||
|
country,
|
||
|
countryCode,
|
||
|
city,
|
||
|
time,
|
||
|
showFlag = true
|
||
|
}: LocationProps): ReactElement<LocationProps> {
|
||
|
return (
|
||
|
<>
|
||
|
{showFlag && (
|
||
|
<Flag
|
||
|
country={{
|
||
|
code: countryCode,
|
||
|
name: country
|
||
|
}}
|
||
|
/>
|
||
|
)}
|
||
|
{city} <span>{time}</span>
|
||
|
</>
|
||
|
)
|
||
|
}
|