import { Link, useLoaderData } from "@remix-run/react"; import type { LoaderFunction } from "@remix-run/server-runtime"; import { API_KEY, API_URL } from "~/lib/constants.server"; import { getChannel } from "~/lib/getChannels"; import type { Channel } from "~/types/channel"; export const loader: LoaderFunction = async ({ params }) => { const id = params.id; const channel = await getChannel(API_KEY, id); return channel; }; const ChannelPage = () => { const channel = useLoaderData(); return ( <>
channel_banner

Videos

Playlists

About

{/* {% if has_pending %} */}

Downloads

{/* {% endif %} */}
channel thumbnail

{channel.data.channel_name}

Subscribers: {channel.data.channel_subs.toLocaleString("en-US")}

{channel.data.channel_subscribed ? ( ) : ( )}

Total Views:{" "} {channel.data.channel_views.toLocaleString("en-US")}

Hide Watched videos:
Sort by:
sort icon
grid plus row grid minus row
grid view list view
{/* */}
); }; export default ChannelPage;