Skip to content

Commit 26f8660

Browse files
committed
Fix search bar
1 parent d6504ed commit 26f8660

File tree

4 files changed

+111
-329
lines changed

4 files changed

+111
-329
lines changed

web/src/app/admin/configuration/document-processing/page.tsx

Lines changed: 64 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import useSWR from "swr";
88
import { ThreeDotsLoader } from "@/components/Loading";
99
import { AdminPageTitle } from "@/components/admin/Title";
1010
import { Lock } from "@phosphor-icons/react";
11+
import Text from "@/components-2/Text";
1112

1213
function Main() {
1314
const {
@@ -53,71 +54,72 @@ function Main() {
5354
return <ThreeDotsLoader />;
5455
}
5556
return (
56-
<div className="container mx-auto p-4">
57-
<CardSection className="mb-8 max-w-2xl bg-white text-text shadow-lg rounded-lg">
58-
<h3 className="text-2xl text-text-800 font-bold mb-4 text-text border-b border-b-border pb-2">
59-
Process with Unstructured API
60-
</h3>
57+
<CardSection className="max-w-2xl flex flex-col gap-spacing-paragraph">
58+
<Text headingH2>Process with Unstructured API</Text>
6159

62-
<div className="space-y-4">
63-
<p className="text-text-600">
64-
Unstructured extracts and transforms complex data from formats like
65-
.pdf, .docx, .png, .pptx, etc. into clean text for Onyx to ingest.
66-
Provide an API key to enable Unstructured document processing.
67-
<br />
68-
<br /> <strong>Note:</strong> this will send documents to
69-
Unstructured servers for processing.
70-
</p>
71-
<p className="text-text-600">
72-
Learn more about Unstructured{" "}
73-
<a
74-
href="https://docs.unstructured.io/welcome"
75-
target="_blank"
76-
rel="noopener noreferrer"
77-
className="text-blue-500 hover:underline font-medium"
78-
>
79-
here
80-
</a>
81-
.
82-
</p>
83-
<div className="mt-4">
84-
{isApiKeySet ? (
85-
<div className="w-full p-3 border rounded-md bg-background text-text flex items-center">
86-
<span className="flex-grow">••••••••••••••••</span>
87-
<Lock className="h-5 w-5 text-text-400" />
88-
</div>
89-
) : (
90-
<input
91-
type="text"
92-
placeholder="Enter API Key"
93-
value={apiKey}
94-
onChange={(e) => setApiKey(e.target.value)}
95-
className="w-full p-3 border rounded-md bg-background text-text focus:ring-2 focus:ring-blue-500 transition duration-200"
96-
/>
97-
)}
98-
</div>
99-
<div className="flex space-x-4 mt-6">
100-
{isApiKeySet ? (
101-
<>
102-
<Button onClick={handleDelete} variant="destructive">
103-
Delete API Key
104-
</Button>
105-
<p className="text-text-600 my-auto">
106-
Delete the current API key before updating.
107-
</p>
108-
</>
109-
) : (
110-
<Button
111-
onClick={handleSave}
112-
className="bg-blue-500 text-white hover:bg-blue-600 transition duration-200"
113-
>
114-
Save API Key
60+
<div className="border-b" />
61+
62+
<div className="space-y-4">
63+
<Text text04>
64+
Unstructured extracts and transforms complex data from formats like
65+
.pdf, .docx, .png, .pptx, etc. into clean text for Onyx to ingest.
66+
Provide an API key to enable Unstructured document processing.
67+
<br />
68+
<br />
69+
<strong>Note:</strong> This will send documents to Unstructured
70+
servers for processing.
71+
</Text>
72+
73+
<Text text04>
74+
Learn more about Unstructured{" "}
75+
<a
76+
href="https://docs.unstructured.io/welcome"
77+
target="_blank"
78+
rel="noopener noreferrer"
79+
className="text-blue-500 hover:underline font-medium"
80+
>
81+
here
82+
</a>
83+
.
84+
</Text>
85+
86+
<div className="mt-4">
87+
{isApiKeySet ? (
88+
<div className="w-full p-3 border rounded-md bg-background text-text flex items-center">
89+
<span className="flex-grow">••••••••••••••••</span>
90+
<Lock className="h-5 w-5 text-text-400" />
91+
</div>
92+
) : (
93+
<input
94+
type="text"
95+
placeholder="Enter API Key"
96+
value={apiKey}
97+
onChange={(e) => setApiKey(e.target.value)}
98+
className="w-full p-3 border rounded-md bg-background text-text focus:ring-2 focus:ring-blue-500 transition duration-200"
99+
/>
100+
)}
101+
</div>
102+
<div className="flex space-x-4 mt-6">
103+
{isApiKeySet ? (
104+
<>
105+
<Button onClick={handleDelete} variant="destructive">
106+
Delete API Key
115107
</Button>
116-
)}
117-
</div>
108+
<p className="text-text-600 my-auto">
109+
Delete the current API key before updating.
110+
</p>
111+
</>
112+
) : (
113+
<Button
114+
onClick={handleSave}
115+
className="bg-blue-500 text-white hover:bg-blue-600 transition duration-200"
116+
>
117+
Save API Key
118+
</Button>
119+
)}
118120
</div>
119-
</CardSection>
120-
</div>
121+
</div>
122+
</CardSection>
121123
);
122124
}
123125

web/src/app/admin/users/page.tsx

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
"use client";
2+
23
import { useState } from "react";
4+
import { FiPlusSquare } from "react-icons/fi";
5+
import useSWR, { mutate } from "swr";
36
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
47
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
58
import { Button } from "@/components/ui/button";
69
import InvitedUserTable from "@/components/admin/users/InvitedUserTable";
710
import SignedUpUserTable from "@/components/admin/users/SignedUpUserTable";
8-
9-
import { FiPlusSquare } from "react-icons/fi";
1011
import { Modal } from "@/components/Modal";
1112
import { ThreeDotsLoader } from "@/components/Loading";
1213
import { AdminPageTitle } from "@/components/admin/Title";
1314
import { usePopup, PopupSpec } from "@/components/admin/connectors/Popup";
1415
import { UsersIcon } from "@/components/icons/icons";
1516
import { errorHandlingFetcher } from "@/lib/fetcher";
16-
import useSWR, { mutate } from "swr";
1717
import { ErrorCallout } from "@/components/ErrorCallout";
1818
import BulkAdd from "@/components/admin/users/BulkAdd";
1919
import Text from "@/components/ui/text";
@@ -22,13 +22,13 @@ import { SearchBar } from "@/components/search/SearchBar";
2222
import { ConfirmEntityModal } from "@/components/modals/ConfirmEntityModal";
2323
import { NEXT_PUBLIC_CLOUD_ENABLED } from "@/lib/constants";
2424
import PendingUsersTable from "@/components/admin/users/PendingUsersTable";
25-
const UsersTables = ({
26-
q,
27-
setPopup,
28-
}: {
25+
26+
interface UsersTablesProps {
2927
q: string;
3028
setPopup: (spec: PopupSpec) => void;
31-
}) => {
29+
}
30+
31+
function UsersTables({ q, setPopup }: UsersTablesProps) {
3232
const {
3333
data: invitedUsers,
3434
error: invitedUsersError,
@@ -130,9 +130,9 @@ const UsersTables = ({
130130
)}
131131
</Tabs>
132132
);
133-
};
133+
}
134134

135-
const SearchableTables = () => {
135+
function SearchableTables() {
136136
const { popup, setPopup } = usePopup();
137137
const [query, setQuery] = useState("");
138138
const [q, setQ] = useState("");
@@ -155,13 +155,13 @@ const SearchableTables = () => {
155155
</div>
156156
</div>
157157
);
158-
};
158+
}
159159

160-
const AddUserButton = ({
161-
setPopup,
162-
}: {
160+
interface AddUserButtonProps {
163161
setPopup: (spec: PopupSpec) => void;
164-
}) => {
162+
}
163+
164+
function AddUserButton({ setPopup }: AddUserButtonProps) {
165165
const [modal, setModal] = useState(false);
166166
const [showConfirmation, setShowConfirmation] = useState(false);
167167

@@ -241,15 +241,13 @@ const AddUserButton = ({
241241
)}
242242
</>
243243
);
244-
};
244+
}
245245

246-
const Page = () => {
246+
export default function Page() {
247247
return (
248248
<div className="mx-auto container">
249249
<AdminPageTitle title="Manage Users" icon={<UsersIcon size={32} />} />
250250
<SearchableTables />
251251
</div>
252252
);
253-
};
254-
255-
export default Page;
253+
}

0 commit comments

Comments
 (0)