dishplanner/frontend-old/app/components/features/dishes/SyncUsersForm.tsx

32 lines
964 B
TypeScript
Raw Normal View History

2025-11-09 13:09:22 +01:00
import React from "react";
2025-10-13 14:57:11 +02:00
import { DishType } from "@/types/DishType";
import { UserType } from "@/types/UserType";
import UserDishCard from "@/components/features/dishes/UserDishCard";
import SectionTitle from "@/components/ui/SectionTitle";
import AddUserToDishForm from "@/components/features/dishes/AddUserToDishForm";
interface Props {
dish: DishType;
reloadDish: () => void;
}
2025-11-09 13:09:22 +01:00
const SyncUsersForm = ({ dish, reloadDish }: Props) => {
2025-10-13 14:57:11 +02:00
return (
<div className="my-2 w-full flex flex-col">
<SectionTitle className="mt-2">Users</SectionTitle>
<AddUserToDishForm dish={dish} reloadDish={reloadDish} />
{dish.users.map((user: UserType) => (
<UserDishCard
key={user.id}
user={user}
dish={dish}
reloadDish={reloadDish}
/>
))}
</div>
);
};
export default SyncUsersForm;