refactor: improve team management, OKRs, and session components
This commit is contained in:
@@ -18,9 +18,15 @@ interface ShareModalConfig {
|
||||
interface BaseSessionLiveWrapperConfig {
|
||||
apiPath: LiveApiPath;
|
||||
shareModal: ShareModalConfig;
|
||||
onShareWithEmail: (email: string, role: ShareRole) => Promise<{ success: boolean; error?: string }>;
|
||||
onShareWithEmail: (
|
||||
email: string,
|
||||
role: ShareRole
|
||||
) => Promise<{ success: boolean; error?: string }>;
|
||||
onRemoveShare: (userId: string) => Promise<unknown>;
|
||||
onShareWithTeam?: (teamId: string, role: ShareRole) => Promise<{ success: boolean; error?: string }>;
|
||||
onShareWithTeam?: (
|
||||
teamId: string,
|
||||
role: ShareRole
|
||||
) => Promise<{ success: boolean; error?: string }>;
|
||||
}
|
||||
|
||||
interface BaseSessionLiveWrapperProps {
|
||||
|
||||
@@ -23,8 +23,14 @@ interface ShareModalProps {
|
||||
isOwner: boolean;
|
||||
userTeams?: TeamWithMembers[];
|
||||
currentUserId?: string;
|
||||
onShareWithEmail: (email: string, role: ShareRole) => Promise<{ success: boolean; error?: string }>;
|
||||
onShareWithTeam?: (teamId: string, role: ShareRole) => Promise<{ success: boolean; error?: string }>;
|
||||
onShareWithEmail: (
|
||||
email: string,
|
||||
role: ShareRole
|
||||
) => Promise<{ success: boolean; error?: string }>;
|
||||
onShareWithTeam?: (
|
||||
teamId: string,
|
||||
role: ShareRole
|
||||
) => Promise<{ success: boolean; error?: string }>;
|
||||
onRemoveShare: (userId: string) => Promise<unknown>;
|
||||
helpText?: React.ReactNode;
|
||||
}
|
||||
@@ -76,7 +82,7 @@ export function ShareModal({
|
||||
} else {
|
||||
const targetEmail =
|
||||
shareType === 'teamMember'
|
||||
? teamMembers.find((m) => m.id === selectedMemberId)?.email ?? ''
|
||||
? (teamMembers.find((m) => m.id === selectedMemberId)?.email ?? '')
|
||||
: email;
|
||||
result = await onShareWithEmail(targetEmail, role);
|
||||
}
|
||||
@@ -154,8 +160,8 @@ export function ShareModal({
|
||||
<div className="space-y-2">
|
||||
{teamMembers.length === 0 ? (
|
||||
<p className="text-sm text-muted">
|
||||
Vous n'êtes membre d'aucune équipe ou vos équipes n'ont pas d'autres membres.
|
||||
Créez une équipe depuis la page{' '}
|
||||
Vous n'êtes membre d'aucune équipe ou vos équipes n'ont pas
|
||||
d'autres membres. Créez une équipe depuis la page{' '}
|
||||
<Link href="/teams" className="text-primary hover:underline">
|
||||
Équipes
|
||||
</Link>
|
||||
@@ -271,7 +277,12 @@ export function ShareModal({
|
||||
className="rounded p-1 text-muted hover:bg-destructive/10 hover:text-destructive"
|
||||
title="Retirer l'accès"
|
||||
>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" className="h-4 w-4">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 20 20"
|
||||
fill="currentColor"
|
||||
className="h-4 w-4"
|
||||
>
|
||||
<path
|
||||
fillRule="evenodd"
|
||||
d="M8.75 1A2.75 2.75 0 006 3.75v.443c-.795.077-1.584.176-2.365.298a.75.75 0 10.23 1.482l.149-.022.841 10.518A2.75 2.75 0 007.596 19h4.807a2.75 2.75 0 002.742-2.53l.841-10.52.149.023a.75.75 0 00.23-1.482A41.03 41.03 0 0014 4.193V3.75A2.75 2.75 0 0011.25 1h-2.5zM10 4c.84 0 1.673.025 2.5.075V3.75c0-.69-.56-1.25-1.25-1.25h-2.5c-.69 0-1.25.56-1.25 1.25v.325C8.327 4.025 9.16 4 10 4zM8.58 7.72a.75.75 0 00-1.5.06l.3 7.5a.75.75 0 101.5-.06l-.3-7.5zm4.34.06a.75.75 0 10-1.5-.06l-.3 7.5a.75.75 0 101.5.06l.3-7.5z"
|
||||
|
||||
Reference in New Issue
Block a user