"use client";
import { useState } from "react";
import { Loader2, Minus, Plus } from "lucide-react";
import {
useCreateNotificationDestination,
useUnlinkNotificationDestinationCompany,
} from "@/hooks/use-notification-destinations";
import type { NotificationDestinationResponse, NotificationType } from "@/lib/types";
/**
* A simplified single-destination view over the full notification
* destinations list, scoped to one company - shows the first destination
* of `type` linked to this company (if any) with an add/remove control.
* Shares the same React Query cache as the Settings page's full
* multi-destination UI, so changes here show up there instantly.
*/
export function NotificationChannelBox({
type,
label,
placeholder,
companyId,
destination,
disabled,
disabledReason,
}: {
type: NotificationType;
label: string;
placeholder: string;
companyId: string;
destination: NotificationDestinationResponse | undefined;
disabled?: boolean;
disabledReason?: string;
}) {
const [value, setValue] = useState("");
const create = useCreateNotificationDestination();
const unlink = useUnlinkNotificationDestinationCompany();
return (