mirror of
https://github.com/hanzoai/shadcn.git
synced 2026-11-02 10:35:35 +00:00
Squash merge of shadcn-ui/ui main branch into hanzo/ui, bringing in: - [email protected] through [email protected] releases - New apps/v4 directory structure - Registry system improvements and MCP server - Framework support (Vue, Svelte, React Native) - New templates (vite-app, monorepo-next, laravel) - Zod 4 compatibility (scoped override for zod@>4) - Test fixture corrections for alias resolution All 867 merge conflicts resolved preserving Hanzo customizations. 1020/1020 shadcn tests pass.
84 lines
2.6 KiB
TypeScript
84 lines
2.6 KiB
TypeScript
"use client"
|
|
|
|
import { Button } from "@/examples/base/ui-rtl/button"
|
|
import { ButtonGroup } from "@/examples/base/ui-rtl/button-group"
|
|
import {
|
|
Popover,
|
|
PopoverContent,
|
|
PopoverTrigger,
|
|
} from "@/examples/base/ui-rtl/popover"
|
|
import { Separator } from "@/examples/base/ui-rtl/separator"
|
|
import { Textarea } from "@/examples/base/ui-rtl/textarea"
|
|
import { BotIcon, ChevronDownIcon } from "lucide-react"
|
|
|
|
import { useLanguageContext } from "@/components/language-selector"
|
|
|
|
const translations = {
|
|
ar: {
|
|
dir: "rtl" as const,
|
|
copilot: "المساعد",
|
|
openPopover: "فتح القائمة",
|
|
agentTasks: "مهام الوكيل",
|
|
placeholder: "صف مهمتك بلغة طبيعية.",
|
|
startTask: "ابدأ مهمة جديدة مع المساعد",
|
|
description:
|
|
"صف مهمتك بلغة طبيعية. سيعمل المساعد في الخلفية ويفتح طلب سحب لمراجعتك.",
|
|
},
|
|
he: {
|
|
dir: "rtl" as const,
|
|
copilot: "עוזר",
|
|
openPopover: "פתח תפריט",
|
|
agentTasks: "משימות סוכן",
|
|
placeholder: "תאר את המשימה שלך בשפה טבעית.",
|
|
startTask: "התחל משימה חדשה עם העוזר",
|
|
description:
|
|
"תאר את המשימה שלך בשפה טבעית. העוזר יעבוד ברקע ויפתח בקשת משיכה לבדיקתך.",
|
|
},
|
|
}
|
|
|
|
export function ButtonGroupPopover() {
|
|
const context = useLanguageContext()
|
|
const lang = context?.language === "he" ? "he" : "ar"
|
|
const t = translations[lang]
|
|
|
|
return (
|
|
<ButtonGroup dir={t.dir}>
|
|
<Button variant="outline" size="sm">
|
|
<BotIcon /> {t.copilot}
|
|
</Button>
|
|
<Popover>
|
|
<PopoverTrigger
|
|
render={
|
|
<Button
|
|
variant="outline"
|
|
size="icon-sm"
|
|
aria-label={t.openPopover}
|
|
/>
|
|
}
|
|
>
|
|
<ChevronDownIcon />
|
|
</PopoverTrigger>
|
|
<PopoverContent
|
|
align="start"
|
|
dir={t.dir}
|
|
data-lang={lang}
|
|
className="p-0"
|
|
>
|
|
<div className="px-4 py-3">
|
|
<div className="text-sm font-medium">{t.agentTasks}</div>
|
|
</div>
|
|
<Separator />
|
|
<div className="p-4 text-sm *:[p:not(:last-child)]:mb-2">
|
|
<Textarea
|
|
placeholder={t.placeholder}
|
|
className="mb-4 resize-none"
|
|
/>
|
|
<p className="font-medium">{t.startTask}</p>
|
|
<p className="text-muted-foreground">{t.description}</p>
|
|
</div>
|
|
</PopoverContent>
|
|
</Popover>
|
|
</ButtonGroup>
|
|
)
|
|
}
|