You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
472 B
18 lines
472 B
import React, { FC } from 'react'
|
|
import { GiphyGif } from '../../../types'
|
|
|
|
interface Props {
|
|
gif: GiphyGif
|
|
selected: boolean
|
|
onSelect: (id: string) => void
|
|
}
|
|
|
|
const Gif: FC<Props> = ({ gif, selected, onSelect }) => {
|
|
return (
|
|
<div className="gif" style={{ borderColor: selected ? '#f00' : '#333' }} onClick={() => onSelect(gif.id)}>
|
|
<img src={gif.images.fixed_height.url} alt={gif.title} />
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default Gif
|