style(panel): refine search and filter layout to align with header

This commit is contained in:
Lemon-miaow committed 2026-07-02 03:30:50 +08:00
1 parent a9dbc8bc61
commit fa7bab5ec1
1 file changed
+12 -8
+12 -8
View File
@@ -46,6 +46,7 @@ export function MyServers() {
return ( return (
<> <>
<div className="flex flex-col gap-4 md:flex-row md:items-center md:justify-between">
<div className="flex items-center gap-3"> <div className="flex items-center gap-3">
<Server className="h-6 w-6 text-primary" /> <Server className="h-6 w-6 text-primary" />
<div> <div>
@@ -57,17 +58,19 @@ export function MyServers() {
</div> </div>
{servers.length > 0 && cfg && ( {servers.length > 0 && cfg && (
<div className="flex flex-col gap-3 sm:flex-row sm:items-center my-4"> <div className="flex flex-col gap-2 sm:flex-row sm:items-center w-full md:w-auto">
<div className="relative flex-1 max-w-md"> <div className="relative w-full sm:w-64">
<Search className="absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground" /> <Search className="pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" />
<Input <Input
placeholder={t("search_placeholder")} placeholder={t("search_placeholder")}
className="pl-9 pr-8" className="h-8 pl-8 pr-8 text-sm"
value={searchQuery} value={searchQuery}
onChange={(e) => { onChange={(e) => {
setSearchQuery(e.target.value); setSearchQuery(e.target.value);
setPage(1); setPage(1);
}} }}
autoComplete="off"
spellCheck={false}
/> />
{searchQuery && ( {searchQuery && (
<button <button
@@ -76,13 +79,13 @@ export function MyServers() {
setSearchQuery(""); setSearchQuery("");
setPage(1); setPage(1);
}} }}
className="absolute right-2.5 top-2.5 text-muted-foreground hover:text-foreground" className="absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground"
> >
<X className="h-4 w-4" /> <X className="h-3.5 w-3.5" />
</button> </button>
)} )}
</div> </div>
<div className="w-[180px]"> <div className="w-full sm:w-36">
<Select <Select
value={statusFilter} value={statusFilter}
onValueChange={(val) => { onValueChange={(val) => {
@@ -90,7 +93,7 @@ export function MyServers() {
setPage(1); setPage(1);
}} }}
> >
<SelectTrigger className="w-full"> <SelectTrigger className="h-8 text-sm">
<SelectValue placeholder={t("filter_status_all")} /> <SelectValue placeholder={t("filter_status_all")} />
</SelectTrigger> </SelectTrigger>
<SelectContent> <SelectContent>
@@ -105,6 +108,7 @@ export function MyServers() {
</div> </div>
</div> </div>
)} )}
</div>
{loading && !data ? ( {loading && !data ? (
<Loading /> <Loading />