mirror of
https://github.com/zhom/donutbrowser.git
synced 2026-09-27 11:41:51 +02:00
refactor: use shared trimming function
This commit is contained in:
@@ -18,6 +18,7 @@ import {
|
|||||||
TooltipContent,
|
TooltipContent,
|
||||||
TooltipTrigger,
|
TooltipTrigger,
|
||||||
} from "@/components/ui/tooltip";
|
} from "@/components/ui/tooltip";
|
||||||
|
import { trimName } from "@/lib/name-utils";
|
||||||
import type { StoredProxy } from "@/types";
|
import type { StoredProxy } from "@/types";
|
||||||
|
|
||||||
interface ProxyManagementDialogProps {
|
interface ProxyManagementDialogProps {
|
||||||
@@ -102,10 +103,6 @@ export function ProxyManagementDialog({
|
|||||||
setEditingProxy(null);
|
setEditingProxy(null);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const trimName = useCallback((name: string) => {
|
|
||||||
return name.length > 30 ? `${name.substring(0, 30)}...` : name;
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Dialog open={isOpen} onOpenChange={onClose}>
|
<Dialog open={isOpen} onOpenChange={onClose}>
|
||||||
|
|||||||
Reference in New Issue
Block a user