import React from "react";
import {
FormField,
FormItem,
FormLabel,
FormControl,
FormMessage,
FormDescription,
} from "@/components/ui/form";
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import { X } from "lucide-react";
import { ManageSubscriberActionFieldsProps } from "@/lib/types";
export function ManageSubscriberActionFields({
form,
index,
lists,
}: ManageSubscriberActionFieldsProps) {
return (
(
Lists
{
const newLists = [...(field.value || []), parseInt(value)];
field.onChange(newLists);
}}
>
{lists.map((list) => (
{list.name}
))}
{field.value?.map((listId: number) => {
const list = lists.find((l) => l.id === listId);
return (
{list ? list.name : `List ${listId}`}
{
const newLists = field.value.filter(
(id: number) => id !== listId
);
field.onChange(newLists);
}}
>
);
})}
Default lists to add this user on creation. (Apart from the lists
for the ghost blog newsletters) p.e. "New Subscribers"
)}
/>
{/* Add more fields specific to manage_subscriber action if needed */}
);
}