Small fixes

This commit is contained in:
2025-06-26 23:44:27 +02:00
parent 14f275f2b8
commit 50cc087bed
2 changed files with 45 additions and 43 deletions

View File

@@ -9,7 +9,7 @@ export default function NotFound() {
Link Not Found
</h2>
<p className="mt-2 text-gray-600 dark:text-gray-400">
The link you're looking for doesn't exist or has expired.
The link you&apos;re looking for doesn&apos;t exist or has expired.
</p>
<Link
href="/"

View File

@@ -238,15 +238,15 @@ export function UrlsDataTable({ data }: UrlsDataTableProps) {
const [columnVisibility, setColumnVisibility] = React.useState<VisibilityState>({})
const router = useRouter()
function handleCopy(string: string) {
const handleCopy = React.useCallback((string: string) => {
navigator.clipboard.writeText(string).then(() => {
toast.success("URL copied to clipboard")
}).catch(() => {
toast.error("Failed to copy URL")
})
}
}, [])
async function handleDelete(id: string) {
const handleDelete = React.useCallback(async (id: string) => {
const res = await deleteUrl(id)
if (res.error) {
@@ -255,8 +255,9 @@ export function UrlsDataTable({ data }: UrlsDataTableProps) {
toast.success("URL deleted successfully")
router.refresh()
}
}
}, [router])
const tableColumns = React.useMemo(() => {
const actionRow: ColumnDef<UrlRecord> = {
id: "actions",
enableHiding: false,
@@ -297,7 +298,8 @@ export function UrlsDataTable({ data }: UrlsDataTableProps) {
}
}
const tableColumns = React.useMemo(() => [...columns, actionRow], [actionRow])
return [...columns, actionRow]
}, [handleCopy, handleDelete])
const table = useReactTable({
data,