refactor: change type annotations from 'any' to 'string' for improved type safety in handleCopy function and related components
This commit is contained in:
@@ -14,7 +14,7 @@ function CustomArrowRightIcon() {
|
||||
}
|
||||
|
||||
export default function Page() {
|
||||
const { theme, setTheme } = useTheme();
|
||||
const { theme } = useTheme();
|
||||
|
||||
const [color, setColor] = useState("#000000");
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
import { useEffect, useState } from "react";
|
||||
import { Card } from "./card";
|
||||
import { CheckIcon, ClipboardCheck, ClipboardIcon } from "lucide-react";
|
||||
import { CheckIcon, ClipboardIcon } from "lucide-react";
|
||||
import { toast } from "sonner";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ const buttonVariants = cva(
|
||||
},
|
||||
);
|
||||
|
||||
const handleCopy = (type: string, value: any) => {
|
||||
const handleCopy = (type: string, value: string) => {
|
||||
navigator.clipboard.writeText(value);
|
||||
|
||||
let amountOfScriptsCopied = localStorage.getItem("amountOfScriptsCopied");
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ClipboardCheck } from "lucide-react";
|
||||
import { toast } from "sonner";
|
||||
|
||||
export default function handleCopy(type: string, value: any) {
|
||||
export default function handleCopy(type: string, value: string) {
|
||||
navigator.clipboard.writeText(value);
|
||||
|
||||
toast.success(`copied ${type} to clipboard`, {
|
||||
|
||||
@@ -5,6 +5,6 @@ export const pbBackup = new PocketBase(
|
||||
process.env.NEXT_PUBLIC_POCKETBASE_URL_BACKUP,
|
||||
);
|
||||
|
||||
export const getImageURL = (recordId: String, fileName: String) => {
|
||||
export const getImageURL = (recordId: string, fileName: string) => {
|
||||
return `${process.env.NEXT_PUBLIC_POCKETBASE_URL}/${recordId}/${fileName}`;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user