mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-18 11:40:39 +09:00
fix(ui): address review follow-ups
This commit is contained in:
parent
a3ecc086d9
commit
51414be269
2 changed files with 3 additions and 2 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
import { useCallback, useMemo, useRef, useState } from "react";
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||||
import { pickTextColorForPillBg } from "@/lib/color-contrast";
|
import { pickTextColorForPillBg } from "@/lib/color-contrast";
|
||||||
import { Link } from "@/lib/router";
|
import { Link } from "@/lib/router";
|
||||||
import type { Issue } from "@paperclipai/shared";
|
import type { Issue } from "@paperclipai/shared";
|
||||||
|
|
@ -25,6 +25,7 @@ import { AgentIcon } from "./AgentIconPicker";
|
||||||
function TruncatedCopyable({ value, icon: Icon }: { value: string; icon: React.ComponentType<{ className?: string }> }) {
|
function TruncatedCopyable({ value, icon: Icon }: { value: string; icon: React.ComponentType<{ className?: string }> }) {
|
||||||
const [copied, setCopied] = useState(false);
|
const [copied, setCopied] = useState(false);
|
||||||
const timerRef = useRef<ReturnType<typeof setTimeout>>(undefined);
|
const timerRef = useRef<ReturnType<typeof setTimeout>>(undefined);
|
||||||
|
useEffect(() => () => clearTimeout(timerRef.current), []);
|
||||||
const handleCopy = useCallback(async () => {
|
const handleCopy = useCallback(async () => {
|
||||||
try {
|
try {
|
||||||
await navigator.clipboard.writeText(value);
|
await navigator.clipboard.writeText(value);
|
||||||
|
|
|
||||||
|
|
@ -883,7 +883,7 @@ export const MarkdownEditor = forwardRef<MarkdownEditorRef, MarkdownEditorProps>
|
||||||
!bordered && "inset-0 rounded-sm",
|
!bordered && "inset-0 rounded-sm",
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
Drop file to upload
|
Drop {onDropFile ? "file" : "image"} to upload
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{uploadError && (
|
{uploadError && (
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue