fix: TS build errors — remove asChild, simplify type selector
- SheetTrigger: remove asChild (base-ui doesn't support it) - ComposeBox: use plain buttons with cn() instead of ToggleGroup (API mismatch) - Remove unused Button import from App Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,7 +3,7 @@ import type { MessageType } from "@/types/MessageType";
|
||||
import { postMessage } from "@/api";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
interface Props {
|
||||
channelId: string;
|
||||
@@ -60,22 +60,24 @@ export function ComposeBox({
|
||||
)}
|
||||
|
||||
<div className="flex items-center gap-1.5 md:gap-2">
|
||||
<ToggleGroup
|
||||
type="single"
|
||||
value={msgType}
|
||||
onValueChange={(v) => { if (v) setMsgType(v as MessageType); }}
|
||||
className="gap-0.5"
|
||||
>
|
||||
{/* Type selector */}
|
||||
<div className="flex gap-0.5 rounded-md border border-border p-0.5">
|
||||
{MSG_TYPES.map((t) => (
|
||||
<ToggleGroupItem
|
||||
<button
|
||||
type="button"
|
||||
key={t.value}
|
||||
value={t.value}
|
||||
className="h-8 w-8 md:h-7 md:w-auto md:px-2 text-xs font-bold data-[state=on]:bg-primary data-[state=on]:text-primary-foreground"
|
||||
onClick={() => setMsgType(t.value)}
|
||||
className={cn(
|
||||
"h-7 w-7 md:h-6 md:w-6 rounded-sm text-xs font-bold transition-colors",
|
||||
msgType === t.value
|
||||
? "bg-primary text-primary-foreground"
|
||||
: "text-muted-foreground hover:text-foreground"
|
||||
)}
|
||||
>
|
||||
{t.label}
|
||||
</ToggleGroupItem>
|
||||
</button>
|
||||
))}
|
||||
</ToggleGroup>
|
||||
</div>
|
||||
|
||||
<Input
|
||||
value={content}
|
||||
|
||||
Reference in New Issue
Block a user