Refactor components to enhance code clarity and maintainability by updating prop types to use Readonly for better immutability. Adjust Result class methods for consistency, and streamline query functions in ChannelDetail and other components to improve performance and readability.
This commit is contained in:
@@ -25,11 +25,11 @@ export function GalleryBrowser({
|
||||
category = 'Library',
|
||||
onSelect,
|
||||
onClose,
|
||||
}: {
|
||||
}: Readonly<{
|
||||
category?: ImageCategory
|
||||
onSelect?: (image: ImagePick) => void
|
||||
onClose?: () => void
|
||||
}) {
|
||||
}>) {
|
||||
const { t } = useTranslation()
|
||||
const queryClient = useQueryClient()
|
||||
const [active, setActive] = useState<ImageCategory>(category)
|
||||
@@ -193,12 +193,12 @@ export function ImageGallery({
|
||||
onOpenChange,
|
||||
category,
|
||||
onSelect,
|
||||
}: {
|
||||
}: Readonly<{
|
||||
open: boolean
|
||||
onOpenChange: (open: boolean) => void
|
||||
category?: ImageCategory
|
||||
onSelect?: (image: ImagePick) => void
|
||||
}) {
|
||||
}>) {
|
||||
const { t } = useTranslation()
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||
|
||||
Reference in New Issue
Block a user