Fixed 'use client' usage.

This commit is contained in:
Mike Cao 2024-02-05 23:59:33 -08:00
parent be5592446a
commit f7151a880e
208 changed files with 323 additions and 385 deletions

View file

@ -1,4 +1,3 @@
'use client';
import { Button, Icon, Icons, Modal, ModalTrigger, Text, useToasts } from 'react-basics';
import WebsiteAddForm from './WebsiteAddForm';
import { useMessages } from 'components/hooks';

View file

@ -1,4 +1,3 @@
'use client';
import {
Form,
FormRow,

View file

@ -1,4 +1,3 @@
'use client';
import { ReactNode } from 'react';
import WebsitesTable from 'app/(main)/settings/websites/WebsitesTable';
import DataTable from 'components/common/DataTable';

View file

@ -1,4 +1,3 @@
'use client';
import { useMessages } from 'components/hooks';
import PageHeader from 'components/layout/PageHeader';
import WebsiteAddButton from './WebsiteAddButton';

View file

@ -3,12 +3,12 @@ import { useLogin } from 'components/hooks';
import WebsitesDataTable from './WebsitesDataTable';
import WebsitesHeader from './WebsitesHeader';
export default function Websites({ teamId }: { teamId: string }) {
export default function WebsitesPage({ teamId }: { teamId: string }) {
const { user } = useLogin();
return (
<>
<WebsitesHeader teamId={teamId} showActions={user.role !== 'view-only'} />
<WebsitesHeader teamId={teamId} allowCreate={user.role !== 'view-only'} />
<WebsitesDataTable teamId={teamId} userId={user.id} allowEdit={true} />
</>
);

View file

@ -1,4 +1,3 @@
'use client';
import { ReactNode } from 'react';
import { Text, Icon, Icons, GridTable, GridColumn, useBreakpoint } from 'react-basics';
import { useMessages, useTeamUrl } from 'components/hooks';

View file

@ -1,4 +1,3 @@
'use client';
import {
Form,
FormRow,

View file

@ -1,4 +1,3 @@
'use client';
import { TextArea } from 'react-basics';
import { useMessages, useConfig } from 'components/hooks';

View file

@ -1,4 +1,3 @@
'use client';
import { Button, Modal, ModalTrigger, ActionForm, useToasts } from 'react-basics';
import { useRouter } from 'next/navigation';
import { useMessages } from 'components/hooks';

View file

@ -1,4 +1,3 @@
'use client';
import { useApi, useMessages } from 'components/hooks';
import TypeConfirmationForm from 'components/common/TypeConfirmationForm';

View file

@ -1,4 +1,3 @@
'use client';
import { useContext, useRef } from 'react';
import {
SubmitButton,

View file

@ -0,0 +1,11 @@
'use client';
import WebsiteProvider from 'app/(main)/websites/[websiteId]/WebsiteProvider';
import WebsiteSettings from './WebsiteSettings';
export default function WebsitePage({ websiteId }: { websiteId: string }) {
return (
<WebsiteProvider websiteId={websiteId}>
<WebsiteSettings websiteId={websiteId} />
</WebsiteProvider>
);
}

View file

@ -1,4 +1,3 @@
'use client';
import { useApi, useMessages } from 'components/hooks';
import TypeConfirmationForm from 'components/common/TypeConfirmationForm';

View file

@ -1,4 +1,3 @@
'use client';
import { useState, Key, useContext } from 'react';
import { Item, Tabs, Button, Text, Icon } from 'react-basics';
import Link from 'next/link';

View file

@ -1,10 +1,10 @@
import WebsiteProvider from 'app/(main)/websites/[websiteId]/WebsiteProvider';
import WebsiteSettings from './WebsiteSettings';
import WebsitePage from './WebsitePage';
import { Metadata } from 'next';
export default async function WebsiteSettingsPage({ params: { websiteId } }) {
return (
<WebsiteProvider websiteId={websiteId}>
<WebsiteSettings websiteId={websiteId} />
</WebsiteProvider>
);
export default async function ({ params: { websiteId } }) {
return <WebsitePage websiteId={websiteId} />;
}
export const metadata: Metadata = {
title: 'Website settings - Umami',
};

View file

@ -1,8 +1,8 @@
import { Metadata } from 'next';
import Websites from './Websites';
import WebsitesPage from './WebsitesPage';
export default function ({ params: { teamId } }: { params: { teamId: string } }) {
return <Websites teamId={teamId} />;
return <WebsitesPage teamId={teamId} />;
}
export const metadata: Metadata = {