From e18c76ca8b2d81867ace60fc25d5d8b4e6288eae Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sun, 17 Dec 2023 22:39:09 -0500 Subject: [PATCH] refactor: swf not needed for now --- app/components/SitesCombobox.tsx | 44 ++++++++++++++++---------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/app/components/SitesCombobox.tsx b/app/components/SitesCombobox.tsx index e17eeef..9084445 100644 --- a/app/components/SitesCombobox.tsx +++ b/app/components/SitesCombobox.tsx @@ -1,39 +1,39 @@ -"use client" +import * as React from "react"; -import * as React from "react" - -import { Button } from "@/components/ui/button" +import { Button } from "@/components/ui/button"; import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, - CommandList -} from "@/components/ui/command" + CommandList, +} from "@/components/ui/command"; import { Popover, PopoverContent, - PopoverTrigger -} from "@/components/ui/popover" -import { ChevronDownIcon } from "@heroicons/react/24/solid" -import useSWR from "swr" -import { getAvailableSites } from "@/utils" + PopoverTrigger, +} from "@/components/ui/popover"; +import { ChevronDownIcon } from "@heroicons/react/24/solid"; +import useSWR from "swr"; +import { getAvailableSites } from "@/utils"; export function SitesCombobox() { - const {data: statuses} = useSWR('/api/statuses', getAvailableSites) - const [open, setOpen] = React.useState(false) - const [selectedStatus, setSelectedStatus] = React.useState( - null - ) + const { statuses } = getAvailableSites(); + const [open, setOpen] = React.useState(false); + const [selectedStatus, setSelectedStatus] = + React.useState(null); return (
- @@ -51,8 +51,8 @@ export function SitesCombobox() { setSelectedStatus( statuses.find((priority) => priority.value === value) || null - ) - setOpen(false) + ); + setOpen(false); }} > {status.label} @@ -64,5 +64,5 @@ export function SitesCombobox() {
- ) + ); }