Skip to content

Commit

Permalink
Update teams.$teamUuid.settings.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
jimniels committed Jan 13, 2025
1 parent 58f1bf0 commit 3184e38
Showing 1 changed file with 39 additions and 22 deletions.
61 changes: 39 additions & 22 deletions quadratic-client/src/routes/teams.$teamUuid.settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { SettingControl } from '@/dashboard/components/SettingControl';
import { useDashboardRouteLoaderData } from '@/routes/_dashboard';
import { getActionUpdateTeam, type TeamAction } from '@/routes/teams.$teamUuid';
import { useGlobalSnackbar } from '@/shared/components/GlobalSnackbarProvider';
import { CheckIcon } from '@/shared/components/Icons';
import { Type } from '@/shared/components/Type';
import { ROUTES } from '@/shared/constants/routes';
import { DOCUMENTATION_ANALYTICS_AI } from '@/shared/constants/urls';
Expand Down Expand Up @@ -115,36 +116,52 @@ export const Component = () => {
Privacy
</Type>

<SettingControl
label="Improve AI results"
description={
<>
Help improve AI results by allowing Quadratic to store and analyze user prompts.{' '}
<a href={DOCUMENTATION_ANALYTICS_AI} target="_blank" className="underline hover:text-primary">
Learn more
</a>
.
</>
}
onCheckedChange={(checked) => {
handleUpdatePreference('analyticsAi', checked);
}}
checked={optimisticSettings.analyticsAi}
className="rounded border border-border p-3 shadow-sm"
/>
<div>
<SettingControl
label="Improve AI results"
description={
<>
Help improve AI results by allowing Quadratic to store and analyze user prompts.{' '}
<a href={DOCUMENTATION_ANALYTICS_AI} target="_blank" className="underline hover:text-primary">
Learn more
</a>
.
</>
}
onCheckedChange={(checked) => {
handleUpdatePreference('analyticsAi', checked);
}}
checked={optimisticSettings.analyticsAi}
className="rounded border border-border px-3 py-2 shadow-sm"
/>
<p className="mt-2 text-sm text-muted-foreground">
When using AI features your data is sent to our providers, all of which have a zero-data data retention
policy. These include:
</p>
<ul className="mt-2 text-sm text-muted-foreground">
{['OpenAI', 'Anthropic', 'AWS Bedrock'].map((item, i) => (
<li className="flex items-center gap-2" key={i}>
<CheckIcon /> <span className="font-semibold">{item}:</span> zero-day data retention
</li>
))}
</ul>
</div>
</Row>
)}
</div>
</>
);
};

function Row(props: { children: ReactNode; className?: string }) {
function Row(props: { children: ReactNode[]; className?: string }) {
if (props.children.length !== 2) {
throw new Error('Row must have exactly two children');
}

return (
<div
className={cn(`flex grid-cols-[160px_1fr] flex-col gap-2 sm:grid sm:max-w-2xl sm:items-center`, props.className)}
>
{props.children}
<div className={cn(`flex grid-cols-[160px_1fr] flex-col gap-2 sm:grid sm:max-w-2xl`, props.className)}>
<div className="pt-2">{props.children[0]}</div>
<div className="">{props.children[1]}</div>
</div>
);
}

0 comments on commit 3184e38

Please sign in to comment.