Add IUCN token support to authentication and API status display.
Replit-Commit-Author: Agent Replit-Commit-Session-Id: e931b5ab-041b-42e7-baf1-50017869cef6 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/e19c6a51-7e4c-4bb8-a6a6-46dc00f0ec99/39e3c295-bd5c-43f6-a0a9-90e6a0a94d73.jpg
This commit is contained in:
@ -11,13 +11,14 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
|
||||
interface AuthenticationPanelProps {
|
||||
token: string;
|
||||
iucnToken?: string;
|
||||
onSave: () => void;
|
||||
}
|
||||
|
||||
export default function AuthenticationPanel({ token, onSave }: AuthenticationPanelProps) {
|
||||
export default function AuthenticationPanel({ token, iucnToken: initialIucnToken, onSave }: AuthenticationPanelProps) {
|
||||
const { toast } = useToast();
|
||||
const [citesToken, setCitesToken] = useState(token || "");
|
||||
const [iucnToken, setIucnToken] = useState("");
|
||||
const [iucnToken, setIucnToken] = useState(initialIucnToken || "");
|
||||
const [activeTab, setActiveTab] = useState("cites");
|
||||
|
||||
// Fetch both tokens from the server
|
||||
|
@ -94,7 +94,10 @@ export default function Home() {
|
||||
</svg>
|
||||
<h1 className="text-xl font-bold">CITES+ Species Lookup</h1>
|
||||
<div className="ml-6">
|
||||
<ApiStatus citesToken={tokensData.token || null} />
|
||||
<ApiStatus
|
||||
citesToken={tokensData.token || null}
|
||||
iucnToken={tokensData.iucnToken || null}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
@ -127,6 +130,7 @@ export default function Home() {
|
||||
{showAuthPanel && (
|
||||
<AuthenticationPanel
|
||||
token={tokensData.token || ""}
|
||||
iucnToken={tokensData.iucnToken || ""}
|
||||
onSave={() => setShowAuthPanel(false)}
|
||||
/>
|
||||
)}
|
||||
|
Reference in New Issue
Block a user