fp/packages/next/app/components/stream-button.tsx

17 lines
622 B
TypeScript
Raw Normal View History

2024-07-10 22:11:18 +00:00
import { IStream } from "types";
2024-01-20 16:16:14 +00:00
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
2024-05-27 22:20:58 +00:00
href={`/archive/${stream.attributes.cuid}`}
2024-01-20 16:16:14 +00:00
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>
)
}