import useRoute from '@/Hooks/useRoute'; import ActionSection from '@/Components/ActionSection'; import ConfirmationModal from '@/Components/ConfirmationModal'; import DangerButton from '@/Components/DangerButton'; import SecondaryButton from '@/Components/SecondaryButton'; import { Team } from '@/types'; import { useForm } from '@inertiajs/react'; import classNames from 'classnames'; import React, { useState } from 'react'; interface Props { team: Team; } export default function DeleteTeamForm({ team }: Props) { const route = useRoute(); const [confirmingTeamDeletion, setConfirmingTeamDeletion] = useState(false); const form = useForm({}); function confirmTeamDeletion() { setConfirmingTeamDeletion(true); } function deleteTeam() { form.delete(route('teams.destroy', [team]), { errorBag: 'deleteTeam', }); } return (
Once a team is deleted, all of its resources and data will be permanently deleted. Before deleting this team, please download any data or information regarding this team that you wish to retain.
Delete Team
{/* */} setConfirmingTeamDeletion(false)} > Are you sure you want to delete this team? Once a team is deleted, all of its resources and data will be permanently deleted. setConfirmingTeamDeletion(false)}> Cancel Delete Team
); }