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.uuid}`}
            className="button is-medium"
        >
            <span className="mr-2"><FontAwesomeIcon icon={faCalendar} className="fas fa-calendar" /></span><span>{new Date(stream.date).toLocaleDateString()}</span>
        </Link>
    )
}