Voice chat pre UI

This commit is contained in:
2026-08-26 01:45:22 +02:00
parent a702834034
commit 0c6f812143
4 changed files with 30 additions and 4 deletions
@@ -1,6 +1,7 @@
import Enclave from "@/app/app"; import Enclave from "@/app/app";
import { ChannelPageProps } from "@/components/page/PageView"; import { ChannelPageProps } from "@/components/page/PageView";
import TextChannel from "./TextChannel"; import TextChannel from "./TextChannel";
import VoiceChannel from "./VoiceChannel";
export default function ChannelPage({ export default function ChannelPage({
appRef, appRef,
@@ -12,5 +13,7 @@ export default function ChannelPage({
switch (appRef.current?.page?.channel.kind) { switch (appRef.current?.page?.channel.kind) {
case "text": case "text":
return <TextChannel appRef={appRef} />; return <TextChannel appRef={appRef} />;
case "voice":
return <VoiceChannel appRef={appRef} />;
} }
} }
@@ -0,0 +1,19 @@
import Enclave from "@/app/app";
import { ChannelPageProps } from "../PageView";
export default function VoiceChannel({
appRef,
}: {
appRef: React.RefObject<Enclave<ChannelPageProps> | null>;
}) {
const channel = appRef.current?.page?.channel;
if (!channel) return null;
return (
<div className="flex flex-col h-screen gap-2">
<header className="px-3 pt-3 pb-3 text-sm text-muted-foreground border-b border-b-border">
<h2>{channel.name}</h2>
</header>
</div>
);
}
+5 -3
View File
@@ -1,16 +1,18 @@
import Enclave from "@/app/app"; import Enclave from "@/app/app";
import { Channel, ChannelKind } from "@/lib/types"; import { Channel, ChannelKind } from "@/lib/types";
import { ChevronDown, ChevronUp, HashIcon } from "lucide-react"; import { ChevronDown, ChevronUp, HashIcon, Volume2Icon } from "lucide-react";
import { useState } from "react"; import { useState } from "react";
import AccountCard from "./AccountCard"; import AccountCard from "./AccountCard";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
export function ChannelIcon({ kind }: { kind: ChannelKind["kind"] }) { export function ChannelIcon({ kind }: { kind: ChannelKind["kind"] }) {
switch (kind) { switch (kind) {
case "category":
return null;
case "text": case "text":
return <HashIcon className="p-0.5" />; return <HashIcon className="p-0.5" />;
default: case "voice":
return null; return <Volume2Icon className="p-0.5" />;
} }
} }
+3 -1
View File
@@ -24,4 +24,6 @@ export interface StoredMessage extends MessageData {
export type Channel = { id: string; name: string } & ChannelKind; export type Channel = { id: string; name: string } & ChannelKind;
export type ChannelKind = export type ChannelKind =
{ kind: "text" } | { kind: "category"; channels: Channel[] }; | { kind: "category"; channels: Channel[] }
| { kind: "voice"; max_users: number }
| { kind: "text" };