{accounts?.map(acc => (
))}
);
} else {
return null;
}
};
export default function WebsiteEditForm({ values, onSave, onClose }) {
const { post } = useApi();
const { data: accounts } = useFetch(`/accounts`);
const { user } = useUser();
const [message, setMessage] = useState();
const handleSubmit = async values => {
const { website_id } = values;
const { ok, data } = await post(website_id ? `/websites/${website_id}` : '/websites', values);
if (ok) {
onSave();
} else {
setMessage(
data ||