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:
Magnus-SmariSma
2025-03-20 23:18:18 +00:00
parent 94824b1676
commit 6655241091
2 changed files with 8 additions and 3 deletions

View File

@ -11,13 +11,14 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
interface AuthenticationPanelProps { interface AuthenticationPanelProps {
token: string; token: string;
iucnToken?: string;
onSave: () => void; onSave: () => void;
} }
export default function AuthenticationPanel({ token, onSave }: AuthenticationPanelProps) { export default function AuthenticationPanel({ token, iucnToken: initialIucnToken, onSave }: AuthenticationPanelProps) {
const { toast } = useToast(); const { toast } = useToast();
const [citesToken, setCitesToken] = useState(token || ""); const [citesToken, setCitesToken] = useState(token || "");
const [iucnToken, setIucnToken] = useState(""); const [iucnToken, setIucnToken] = useState(initialIucnToken || "");
const [activeTab, setActiveTab] = useState("cites"); const [activeTab, setActiveTab] = useState("cites");
// Fetch both tokens from the server // Fetch both tokens from the server

View File

@ -94,7 +94,10 @@ export default function Home() {
</svg> </svg>
<h1 className="text-xl font-bold">CITES+ Species Lookup</h1> <h1 className="text-xl font-bold">CITES+ Species Lookup</h1>
<div className="ml-6"> <div className="ml-6">
<ApiStatus citesToken={tokensData.token || null} /> <ApiStatus
citesToken={tokensData.token || null}
iucnToken={tokensData.iucnToken || null}
/>
</div> </div>
</div> </div>
<div> <div>
@ -127,6 +130,7 @@ export default function Home() {
{showAuthPanel && ( {showAuthPanel && (
<AuthenticationPanel <AuthenticationPanel
token={tokensData.token || ""} token={tokensData.token || ""}
iucnToken={tokensData.iucnToken || ""}
onSave={() => setShowAuthPanel(false)} onSave={() => setShowAuthPanel(false)}
/> />
)} )}