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:
@@ -5,32 +5,32 @@ import FormLink from '~/components/form/form_link';
|
||||
import { LinkWithCollection } from '~/types/app';
|
||||
|
||||
export default function DeleteLinkPage({ link }: { link: LinkWithCollection }) {
|
||||
const { t } = useTranslation('common');
|
||||
const { data, setData, submit, processing } = useForm({
|
||||
name: link.name,
|
||||
description: link.description,
|
||||
url: link.url,
|
||||
favorite: link.favorite,
|
||||
collectionId: link.collectionId,
|
||||
});
|
||||
const { t } = useTranslation('common');
|
||||
const { data, setData, submit, processing } = useForm({
|
||||
name: link.name,
|
||||
description: link.description,
|
||||
url: link.url,
|
||||
favorite: link.favorite,
|
||||
collectionId: link.collectionId,
|
||||
});
|
||||
|
||||
const handleSubmit = () => {
|
||||
const { method, url } = route('link.delete', {
|
||||
params: { id: link.id.toString() },
|
||||
});
|
||||
submit(method, url);
|
||||
};
|
||||
const handleSubmit = () => {
|
||||
const { method, url } = route('link.delete', {
|
||||
params: { id: link.id.toString() },
|
||||
});
|
||||
submit(method, url);
|
||||
};
|
||||
|
||||
return (
|
||||
<FormLink
|
||||
title={t('link.delete')}
|
||||
canSubmit={!processing}
|
||||
data={data}
|
||||
setData={setData}
|
||||
handleSubmit={handleSubmit}
|
||||
collections={[link.collection]}
|
||||
disableInputs
|
||||
submitBtnDanger
|
||||
/>
|
||||
);
|
||||
return (
|
||||
<FormLink
|
||||
title={t('link.delete')}
|
||||
canSubmit={!processing}
|
||||
data={data}
|
||||
setData={setData}
|
||||
handleSubmit={handleSubmit}
|
||||
collections={[link.collection]}
|
||||
disableInputs
|
||||
submitBtnDanger
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user