mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-20 23:21:06 +02:00
refactor: simplify layout structure in user settings components
This commit is contained in:
parent
71f4f77f26
commit
fce465a40f
2 changed files with 39 additions and 62 deletions
|
|
@ -78,7 +78,7 @@ export function ProfileContent() {
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<form onSubmit={handleSubmit} className="space-y-6">
|
<form onSubmit={handleSubmit} className="space-y-6">
|
||||||
<div className="rounded-lg border bg-card p-6">
|
<div className="rounded-lg bg-card">
|
||||||
<div className="flex flex-col gap-6">
|
<div className="flex flex-col gap-6">
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<Label>{t("profile_avatar")}</Label>
|
<Label>{t("profile_avatar")}</Label>
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ import { toast } from "sonner";
|
||||||
import { updateSearchSpaceMutationAtom } from "@/atoms/search-spaces/search-space-mutation.atoms";
|
import { updateSearchSpaceMutationAtom } from "@/atoms/search-spaces/search-space-mutation.atoms";
|
||||||
import { Alert, AlertDescription } from "@/components/ui/alert";
|
import { Alert, AlertDescription } from "@/components/ui/alert";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
|
||||||
import { Input } from "@/components/ui/input";
|
import { Input } from "@/components/ui/input";
|
||||||
import { Label } from "@/components/ui/label";
|
import { Label } from "@/components/ui/label";
|
||||||
import { Skeleton } from "@/components/ui/skeleton";
|
import { Skeleton } from "@/components/ui/skeleton";
|
||||||
|
|
@ -83,16 +82,10 @@ export function GeneralSettingsManager({ searchSpaceId }: GeneralSettingsManager
|
||||||
if (loading) {
|
if (loading) {
|
||||||
return (
|
return (
|
||||||
<div className="space-y-4 md:space-y-6">
|
<div className="space-y-4 md:space-y-6">
|
||||||
<Card>
|
<div className="flex flex-col gap-6">
|
||||||
<CardHeader className="px-3 md:px-6 pt-3 md:pt-6 pb-2 md:pb-3">
|
<Skeleton className="h-10 md:h-12 w-full" />
|
||||||
<Skeleton className="h-5 md:h-6 w-36 md:w-48" />
|
<Skeleton className="h-10 md:h-12 w-full" />
|
||||||
<Skeleton className="h-3 md:h-4 w-full max-w-md mt-2" />
|
</div>
|
||||||
</CardHeader>
|
|
||||||
<CardContent className="space-y-3 md:space-y-4 px-3 md:px-6 pb-3 md:pb-6">
|
|
||||||
<Skeleton className="h-10 md:h-12 w-full" />
|
|
||||||
<Skeleton className="h-10 md:h-12 w-full" />
|
|
||||||
</CardContent>
|
|
||||||
</Card>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -113,61 +106,45 @@ export function GeneralSettingsManager({ searchSpaceId }: GeneralSettingsManager
|
||||||
<Alert className="bg-muted/50 py-3 md:py-4">
|
<Alert className="bg-muted/50 py-3 md:py-4">
|
||||||
<Info className="h-3 w-3 md:h-4 md:w-4 shrink-0" />
|
<Info className="h-3 w-3 md:h-4 md:w-4 shrink-0" />
|
||||||
<AlertDescription className="text-xs md:text-sm">
|
<AlertDescription className="text-xs md:text-sm">
|
||||||
Update your search space name and description. These details help identify and organize
|
Update your search space name and description.
|
||||||
your workspace.
|
|
||||||
</AlertDescription>
|
</AlertDescription>
|
||||||
</Alert>
|
</Alert>
|
||||||
|
|
||||||
{/* Search Space Details Card */}
|
<form onSubmit={onSubmit} className="space-y-6">
|
||||||
<form onSubmit={onSubmit} className="space-y-4 md:space-y-6">
|
<div className="flex flex-col gap-6">
|
||||||
<Card>
|
<div className="space-y-2">
|
||||||
<CardHeader className="px-3 md:px-6 pt-3 md:pt-6 pb-2 md:pb-3">
|
<Label htmlFor="search-space-name">
|
||||||
<CardTitle className="text-base md:text-lg">Search Space Details</CardTitle>
|
{t("general_name_label")}
|
||||||
<CardDescription className="text-xs md:text-sm">
|
</Label>
|
||||||
Manage the basic information for this search space.
|
<Input
|
||||||
</CardDescription>
|
id="search-space-name"
|
||||||
</CardHeader>
|
placeholder={t("general_name_placeholder")}
|
||||||
<CardContent className="space-y-4 md:space-y-5 px-3 md:px-6 pb-3 md:pb-6">
|
value={name}
|
||||||
<div className="space-y-1.5 md:space-y-2">
|
onChange={(e) => setName(e.target.value)}
|
||||||
<Label htmlFor="search-space-name" className="text-sm md:text-base font-medium">
|
/>
|
||||||
{t("general_name_label")}
|
<p className="text-xs text-muted-foreground">
|
||||||
</Label>
|
{t("general_name_description")}
|
||||||
<Input
|
</p>
|
||||||
id="search-space-name"
|
</div>
|
||||||
placeholder={t("general_name_placeholder")}
|
|
||||||
value={name}
|
|
||||||
onChange={(e) => setName(e.target.value)}
|
|
||||||
className="text-sm md:text-base h-9 md:h-10"
|
|
||||||
/>
|
|
||||||
<p className="text-[10px] md:text-xs text-muted-foreground">
|
|
||||||
{t("general_name_description")}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="space-y-1.5 md:space-y-2">
|
<div className="space-y-2">
|
||||||
<Label
|
<Label htmlFor="search-space-description">
|
||||||
htmlFor="search-space-description"
|
{t("general_description_label")}{" "}
|
||||||
className="text-sm md:text-base font-medium"
|
<span className="text-muted-foreground font-normal">({tCommon("optional")})</span>
|
||||||
>
|
</Label>
|
||||||
{t("general_description_label")}{" "}
|
<Input
|
||||||
<span className="text-muted-foreground font-normal">({tCommon("optional")})</span>
|
id="search-space-description"
|
||||||
</Label>
|
placeholder={t("general_description_placeholder")}
|
||||||
<Input
|
value={description}
|
||||||
id="search-space-description"
|
onChange={(e) => setDescription(e.target.value)}
|
||||||
placeholder={t("general_description_placeholder")}
|
/>
|
||||||
value={description}
|
<p className="text-xs text-muted-foreground">
|
||||||
onChange={(e) => setDescription(e.target.value)}
|
{t("general_description_description")}
|
||||||
className="text-sm md:text-base h-9 md:h-10"
|
</p>
|
||||||
/>
|
</div>
|
||||||
<p className="text-[10px] md:text-xs text-muted-foreground">
|
</div>
|
||||||
{t("general_description_description")}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</CardContent>
|
|
||||||
</Card>
|
|
||||||
|
|
||||||
{/* Action Buttons */}
|
<div className="flex justify-end">
|
||||||
<div className="flex justify-end pt-3 md:pt-4">
|
|
||||||
<Button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue