/** * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com). * * WSO2 LLC. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except * in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import { OrganizationDetails, Preferences } from '@asgardeo/browser'; import { FC, ReactElement, ReactNode } from 'react'; export interface BaseOrganizationProfileProps { /** * Callback fired when the cancel button is clicked (only used in editable mode). */ cancelButtonText?: string; /** * Whether to display the profile in a card layout. */ cardLayout?: boolean; /** * CSS class name for styling the component. */ className?: string; /** * Whether the organization profile is editable. */ editable?: boolean; /** * Component to render when no organization data is available. */ fallback?: ReactElement; /** * Array of field configurations to display. Each field specifies what organization data to show. */ fields?: Array<{ editable?: boolean; key: keyof OrganizationDetails | 'attributes'; label: string; render?: (value: any, organization: OrganizationDetails) => ReactNode; }>; /** * Display mode for the component. */ mode?: 'inline' | 'popup'; /** * Callback fired when a field value changes. */ onChange?: (field: string, value: any) => void; /** * Callback fired when the popup should be closed (only used in popup mode). */ onOpenChange?: (open: boolean) => void; /** * Callback fired when the form is submitted (only used in editable mode). */ onSubmit?: (data: any) => void; /** * Callback fired when the organization should be updated. */ onUpdate?: (payload: any) => Promise; /** * Whether the popup is open (only used in popup mode). */ open?: boolean; /** * The organization details to display. */ organization?: OrganizationDetails | null; /** * Component-level preferences to override global i18n and theme settings. * Preferences are deep-merged with global ones, with component preferences * taking precedence. Affects this component and all its descendants. */ preferences?: Preferences; /** * Text for the save button (only used in editable mode). */ saveButtonText?: string; /** * Custom subheading for the profile. */ subheading?: string; /** * Custom title for the profile. */ title?: string; } /** * BaseOrganizationProfile component displays organization information in a * structured and styled format. It shows organization details such as name, * description, status, and other available information with support for inline editing. * * This is the base component that can be used in any context where you have * an organization object available. It provides editing capabilities similar to * the UserProfile component, allowing users to modify organization fields directly. * * @example * ```tsx * // Basic usage * * * // With editing enabled and update handler * { * await updateOrganizationAPI(orgId, payload); * }} * /> * * // With card layout and custom title * No organization data available} * /> * * // With custom fields configuration * value || 'No description' }, * { key: 'created', label: 'Created Date', editable: false, render: (value) => new Date(value).toLocaleDateString() }, * { key: 'attributes', label: 'Custom Attributes', editable: true } * ]} * onUpdate={handleUpdate} * /> * * // In popup mode * * ``` * value || 'No description' }, * { key: 'created', label: 'Created Date', render: (value) => new Date(value).toLocaleDateString() }, * { key: 'attributes', label: 'Custom Attributes' } * ]} * /> * ``` */ declare const BaseOrganizationProfile: FC; export default BaseOrganizationProfile; //# sourceMappingURL=BaseOrganizationProfile.d.ts.map