migrated to nextjs 13 app dir

This commit is contained in:
Ren Amamiya
2023-04-15 09:06:29 +07:00
parent da38ced72c
commit d59cc041d5
56 changed files with 617 additions and 807 deletions

28
src/app/channels/page.tsx Normal file
View File

@@ -0,0 +1,28 @@
'use client';
import { BrowseChannelItem } from '@components/channels/browseChannelItem';
import { useEffect, useState } from 'react';
export default function Page() {
const [list, setList] = useState([]);
useEffect(() => {
const fetchChannels = async () => {
const { getChannels } = await import('@utils/bindings');
return await getChannels({ limit: 100, offset: 0 });
};
fetchChannels()
.then((res) => setList(res))
.catch(console.error);
}, []);
return (
<div className="h-full w-full overflow-y-auto">
{list.map((channel) => (
<BrowseChannelItem key={channel.id} data={channel} />
))}
</div>
);
}