17 lines
634 B
TypeScript
17 lines
634 B
TypeScript
|
import { IStream } from "@futureporn/types";
|
||
|
import Link from "next/link"
|
||
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||
|
import { faCalendar } from "@fortawesome/free-solid-svg-icons";
|
||
|
|
||
|
export function StreamButton({ stream }: { stream: IStream }) {
|
||
|
if (!stream) return <></>
|
||
|
|
||
|
return (
|
||
|
<Link
|
||
|
href={`/archive/${stream.attributes.cuid}`}
|
||
|
className="button is-medium"
|
||
|
>
|
||
|
<span className="mr-2"><FontAwesomeIcon icon={faCalendar} className="fas fa-calendar" /></span><span>{new Date(stream.attributes.date).toLocaleDateString()}</span>
|
||
|
</Link>
|
||
|
)
|
||
|
}
|