Something went wrong. Try again.
[mirror] A local-first desktop markdown writer with grammar checking, at proto integration, and more github.com/stormlightlabs/writer/releases
atproto codemirror markdown tauri rust react
Something went wrong. Try again.
1.6 kB · 54 lines
TSX
at main
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455import { Button } from "$components/Button";import { XIcon } from "$icons";import type { SettingsScope } from "$types";import { cn } from "$utils/tw";
type SettingsHeaderProps = { title: string; scope: SettingsScope; onClose: () => void; closeAriaLabel: string; onViewMore?: () => void;};
export function SettingsHeader({ title, scope, onClose, closeAriaLabel, onViewMore }: SettingsHeaderProps) { const isFull = scope === "full";
return ( <div className={cn( "flex items-center justify-between gap-3", isFull ? "mb-4 border-b border-stroke-subtle pb-3" : "mb-2", )}> <div> <h2 className={cn("m-0 text-text-primary", isFull ? "text-base font-semibold" : "text-sm font-medium")}> {title} </h2> {isFull && ( <p className="m-0 mt-1 text-xs text-text-secondary">Expanded controls for layout and writing tools.</p> )} </div> <div className="flex items-center gap-2"> {onViewMore && ( <Button type="button" variant="outline" size="sm" onClick={onViewMore} className="hover:bg-accent-blue/10 hover:text-accent-blue"> View more </Button> )} <Button type="button" variant="iconSubtle" size="iconLg" onClick={onClose} aria-label={closeAriaLabel} className="hover:bg-support-error/10 hover:text-support-error"> <XIcon size="sm" /> </Button> </div> </div> );}