mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 16:59:12 +00:00
parent
e0aaa0bcab
commit
286f2f53f7
20 changed files with 61 additions and 63 deletions
|
@ -1,5 +1,4 @@
|
|||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||
|
||||
import { classNames, IsEmptyDate, simplifyDate } from "../../utils";
|
||||
import { IrcNetworkAddForm, IrcNetworkUpdateForm } from "../../forms";
|
||||
import { useToggle } from "../../hooks/hooks";
|
||||
|
@ -10,7 +9,6 @@ import { Menu, Switch, Transition } from "@headlessui/react";
|
|||
import { Fragment, useRef } from "react";
|
||||
import { DeleteModal } from "../../components/modals";
|
||||
import { useState, useMemo } from "react";
|
||||
|
||||
import { toast } from "react-hot-toast";
|
||||
import Toast from "../../components/notifications/Toast";
|
||||
import {
|
||||
|
@ -30,8 +28,6 @@ interface SortConfig {
|
|||
function useSort(items: ListItemProps["network"][], config?: SortConfig) {
|
||||
const [sortConfig, setSortConfig] = useState(config);
|
||||
|
||||
|
||||
|
||||
const sortedItems = useMemo(() => {
|
||||
if (!sortConfig) {
|
||||
return items;
|
||||
|
@ -79,7 +75,6 @@ function useSort(items: ListItemProps["network"][], config?: SortConfig) {
|
|||
return { items: sortedItems, requestSort, sortConfig, getSortIndicator };
|
||||
}
|
||||
|
||||
|
||||
const IrcSettings = () => {
|
||||
const [expandNetworks, toggleExpand] = useToggle(false);
|
||||
const [addNetworkIsOpen, toggleAddNetwork] = useToggle(false);
|
||||
|
@ -92,7 +87,6 @@ const IrcSettings = () => {
|
|||
|
||||
const sortedNetworks = useSort(data || []);
|
||||
|
||||
|
||||
return (
|
||||
<div className="lg:col-span-9">
|
||||
<IrcNetworkAddForm isOpen={addNetworkIsOpen} toggle={toggleAddNetwork} />
|
||||
|
@ -209,6 +203,7 @@ const ListItem = ({ idx, network, expanded }: ListItemProps) => {
|
|||
const [edit, toggleEdit] = useToggle(false);
|
||||
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
const mutation = useMutation(
|
||||
(network: IrcNetwork) => APIClient.irc.updateNetwork(network),
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue