import { Clipboard } from "lucide-react"; import { useTranslation } from "react-i18next"; import { channelUiPresentation } from "@/channel-plugins/registry"; import { Button } from "@/components/ui/button"; import { type ChannelProviderPreset, type ChannelSetupPresentation, } from "@/components/settings/channels/catalog"; import { copyTextToClipboard } from "@/lib/clipboard"; import type { NanobotFeatureInfo } from "@/lib/types"; export function ChannelSetupActions({ feature, setup, onNotice, }: { feature: NanobotFeatureInfo; setup: ChannelSetupPresentation; onNotice: (message: string | null) => void; }) { const { t } = useTranslation(); if (!setup.actions?.length) return null; return (
{setup.actions.map((action) => ( ))} {channelUiPresentation(feature.name, feature.webui)?.displayName ?? feature.display_name}
); } export function ChannelProviderPresets({ presets, onApply, label, disabled = false, }: { presets: ChannelProviderPreset[]; onApply: (preset: ChannelProviderPreset) => void; label?: string; disabled?: boolean; }) { const { t } = useTranslation(); if (!presets.length) return null; return (
{label ?? t("settings.channels.providerPreset", { defaultValue: "Provider" })}
{presets.map((preset) => ( ))}
); }