rotate dropdown button
This commit is contained in:
parent
e0fdb32843
commit
3735b3a188
1 changed files with 11 additions and 2 deletions
|
|
@ -37,12 +37,14 @@ import GoogleDriveIcon from "@/app/settings/icons/google-drive-icon";
|
||||||
import OneDriveIcon from "@/app/settings/icons/one-drive-icon";
|
import OneDriveIcon from "@/app/settings/icons/one-drive-icon";
|
||||||
import SharePointIcon from "@/app/settings/icons/share-point-icon";
|
import SharePointIcon from "@/app/settings/icons/share-point-icon";
|
||||||
import AwsIcon from "@/app/settings/icons/aws-icon";
|
import AwsIcon from "@/app/settings/icons/aws-icon";
|
||||||
|
import { cn } from "@/lib/utils";
|
||||||
|
|
||||||
export function KnowledgeDropdown() {
|
export function KnowledgeDropdown() {
|
||||||
const { addTask } = useTask();
|
const { addTask } = useTask();
|
||||||
const { refetch: refetchTasks } = useGetTasksQuery();
|
const { refetch: refetchTasks } = useGetTasksQuery();
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
||||||
const [showFolderDialog, setShowFolderDialog] = useState(false);
|
const [showFolderDialog, setShowFolderDialog] = useState(false);
|
||||||
const [showS3Dialog, setShowS3Dialog] = useState(false);
|
const [showS3Dialog, setShowS3Dialog] = useState(false);
|
||||||
const [showDuplicateDialog, setShowDuplicateDialog] = useState(false);
|
const [showDuplicateDialog, setShowDuplicateDialog] = useState(false);
|
||||||
|
|
@ -474,7 +476,7 @@ export function KnowledgeDropdown() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<DropdownMenu>
|
<DropdownMenu onOpenChange={setIsMenuOpen}>
|
||||||
<DropdownMenuTrigger asChild>
|
<DropdownMenuTrigger asChild>
|
||||||
<Button disabled={isLoading}>
|
<Button disabled={isLoading}>
|
||||||
{isLoading && <Loader2 className="h-4 w-4 animate-spin" />}
|
{isLoading && <Loader2 className="h-4 w-4 animate-spin" />}
|
||||||
|
|
@ -491,7 +493,14 @@ export function KnowledgeDropdown() {
|
||||||
: "Processing..."
|
: "Processing..."
|
||||||
: "Add Knowledge"}
|
: "Add Knowledge"}
|
||||||
</span>
|
</span>
|
||||||
{!isLoading && <ChevronDown className="h-4 w-4" />}
|
{!isLoading && (
|
||||||
|
<ChevronDown
|
||||||
|
className={cn(
|
||||||
|
"h-4 w-4 transition-transform duration-200",
|
||||||
|
isMenuOpen && "rotate-180"
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</Button>
|
</Button>
|
||||||
</DropdownMenuTrigger>
|
</DropdownMenuTrigger>
|
||||||
<DropdownMenuContent align="end" className="w-56">
|
<DropdownMenuContent align="end" className="w-56">
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue