mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-10 15:35:35 +00:00
refactor: use tabs instead of spaces
This commit is contained in:
@@ -2,40 +2,40 @@ import { useForm } from '@inertiajs/react';
|
||||
import { route } from '@izzyjs/route/client';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import FormCollection, {
|
||||
FormCollectionData,
|
||||
FormCollectionData,
|
||||
} from '~/components/form/form_collection';
|
||||
import { Collection } from '~/types/app';
|
||||
|
||||
export default function DeleteCollectionPage({
|
||||
collection,
|
||||
collection,
|
||||
}: {
|
||||
collection: Collection;
|
||||
collection: Collection;
|
||||
}) {
|
||||
const { t } = useTranslation('common');
|
||||
const { data, setData, submit, processing, errors } =
|
||||
useForm<FormCollectionData>({
|
||||
name: collection.name,
|
||||
description: collection.description,
|
||||
visibility: collection.visibility,
|
||||
});
|
||||
const { t } = useTranslation('common');
|
||||
const { data, setData, submit, processing, errors } =
|
||||
useForm<FormCollectionData>({
|
||||
name: collection.name,
|
||||
description: collection.description,
|
||||
visibility: collection.visibility,
|
||||
});
|
||||
|
||||
const handleSubmit = () => {
|
||||
const { method, url } = route('collection.delete', {
|
||||
params: { id: collection.id.toString() },
|
||||
});
|
||||
submit(method, url);
|
||||
};
|
||||
const handleSubmit = () => {
|
||||
const { method, url } = route('collection.delete', {
|
||||
params: { id: collection.id.toString() },
|
||||
});
|
||||
submit(method, url);
|
||||
};
|
||||
|
||||
return (
|
||||
<FormCollection
|
||||
title={t('collection.delete')}
|
||||
canSubmit={!processing}
|
||||
data={data}
|
||||
setData={setData}
|
||||
handleSubmit={handleSubmit}
|
||||
errors={errors as any}
|
||||
disableInputs
|
||||
submitBtnDanger
|
||||
/>
|
||||
);
|
||||
return (
|
||||
<FormCollection
|
||||
title={t('collection.delete')}
|
||||
canSubmit={!processing}
|
||||
data={data}
|
||||
setData={setData}
|
||||
handleSubmit={handleSubmit}
|
||||
errors={errors as any}
|
||||
disableInputs
|
||||
submitBtnDanger
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user