Refactor function components across multiple files
Function components have been refactored across the codebase. Single export-const arrow function components have been adapted into traditional function declarations. This change provides better stack trace in case of errors and better function and argument names on runtime debugging.
This commit is contained in:
@@ -16,11 +16,15 @@ import { Trans } from '@kit/ui/trans';
|
||||
|
||||
import { deleteInvitationAction } from '../../server/actions/team-invitations-server-actions';
|
||||
|
||||
export const DeleteInvitationDialog: React.FC<{
|
||||
export function DeleteInvitationDialog({
|
||||
isOpen,
|
||||
setIsOpen,
|
||||
invitationId,
|
||||
}: {
|
||||
isOpen: boolean;
|
||||
setIsOpen: (isOpen: boolean) => void;
|
||||
invitationId: number;
|
||||
}> = ({ isOpen, setIsOpen, invitationId }) => {
|
||||
}) {
|
||||
return (
|
||||
<AlertDialog open={isOpen} onOpenChange={setIsOpen}>
|
||||
<AlertDialogContent>
|
||||
@@ -41,7 +45,7 @@ export const DeleteInvitationDialog: React.FC<{
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
function DeleteInvitationForm({
|
||||
invitationId,
|
||||
|
||||
@@ -16,12 +16,17 @@ import { Trans } from '@kit/ui/trans';
|
||||
|
||||
import { renewInvitationAction } from '../../server/actions/team-invitations-server-actions';
|
||||
|
||||
export const RenewInvitationDialog: React.FC<{
|
||||
export function RenewInvitationDialog({
|
||||
isOpen,
|
||||
setIsOpen,
|
||||
invitationId,
|
||||
email,
|
||||
}: {
|
||||
isOpen: boolean;
|
||||
setIsOpen: (isOpen: boolean) => void;
|
||||
invitationId: number;
|
||||
email: string;
|
||||
}> = ({ isOpen, setIsOpen, invitationId, email }) => {
|
||||
}) {
|
||||
return (
|
||||
<AlertDialog open={isOpen} onOpenChange={setIsOpen}>
|
||||
<AlertDialogContent>
|
||||
@@ -45,7 +50,7 @@ export const RenewInvitationDialog: React.FC<{
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
function RenewInvitationForm({
|
||||
invitationId,
|
||||
|
||||
@@ -32,13 +32,19 @@ import { RolesDataProvider } from '../members/roles-data-provider';
|
||||
|
||||
type Role = string;
|
||||
|
||||
export const UpdateInvitationDialog: React.FC<{
|
||||
export function UpdateInvitationDialog({
|
||||
isOpen,
|
||||
setIsOpen,
|
||||
invitationId,
|
||||
userRole,
|
||||
userRoleHierarchy,
|
||||
}: {
|
||||
isOpen: boolean;
|
||||
setIsOpen: (isOpen: boolean) => void;
|
||||
invitationId: number;
|
||||
userRole: Role;
|
||||
userRoleHierarchy: number;
|
||||
}> = ({ isOpen, setIsOpen, invitationId, userRole, userRoleHierarchy }) => {
|
||||
}) {
|
||||
return (
|
||||
<Dialog open={isOpen} onOpenChange={setIsOpen}>
|
||||
<DialogContent>
|
||||
@@ -61,7 +67,7 @@ export const UpdateInvitationDialog: React.FC<{
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
function UpdateInvitationForm({
|
||||
invitationId,
|
||||
|
||||
Reference in New Issue
Block a user