Function bodies 124 total
SheetTrigger function · typescript · L13-L17 (5 LOC)src/components/ui/sheet.tsx
function SheetTrigger({
...props
}: React.ComponentProps<typeof SheetPrimitive.Trigger>) {
return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />
}SheetClose function · typescript · L19-L23 (5 LOC)src/components/ui/sheet.tsx
function SheetClose({
...props
}: React.ComponentProps<typeof SheetPrimitive.Close>) {
return <SheetPrimitive.Close data-slot="sheet-close" {...props} />
}SheetPortal function · typescript · L25-L29 (5 LOC)src/components/ui/sheet.tsx
function SheetPortal({
...props
}: React.ComponentProps<typeof SheetPrimitive.Portal>) {
return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />
}SheetOverlay function · typescript · L31-L45 (15 LOC)src/components/ui/sheet.tsx
function SheetOverlay({
className,
...props
}: React.ComponentProps<typeof SheetPrimitive.Overlay>) {
return (
<SheetPrimitive.Overlay
data-slot="sheet-overlay"
className={cn(
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
className
)}
{...props}
/>
)
}SheetContent function · typescript · L47-L86 (40 LOC)src/components/ui/sheet.tsx
function SheetContent({
className,
children,
side = "right",
showCloseButton = true,
...props
}: React.ComponentProps<typeof SheetPrimitive.Content> & {
side?: "top" | "right" | "bottom" | "left"
showCloseButton?: boolean
}) {
return (
<SheetPortal>
<SheetOverlay />
<SheetPrimitive.Content
data-slot="sheet-content"
className={cn(
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
side === "right" &&
"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
side === "left" &&
"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
side === "top" &&
"data-[state=closed]SheetHeader function · typescript · L88-L96 (9 LOC)src/components/ui/sheet.tsx
function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="sheet-header"
className={cn("flex flex-col gap-1.5 p-4", className)}
{...props}
/>
)
}SheetFooter function · typescript · L98-L106 (9 LOC)src/components/ui/sheet.tsx
function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
data-slot="sheet-footer"
className={cn("mt-auto flex flex-col gap-2 p-4", className)}
{...props}
/>
)
}About: code-quality intelligence by Repobility · https://repobility.com
SheetTitle function · typescript · L108-L119 (12 LOC)src/components/ui/sheet.tsx
function SheetTitle({
className,
...props
}: React.ComponentProps<typeof SheetPrimitive.Title>) {
return (
<SheetPrimitive.Title
data-slot="sheet-title"
className={cn("text-foreground font-semibold", className)}
{...props}
/>
)
}SheetDescription function · typescript · L121-L132 (12 LOC)src/components/ui/sheet.tsx
function SheetDescription({
className,
...props
}: React.ComponentProps<typeof SheetPrimitive.Description>) {
return (
<SheetPrimitive.Description
data-slot="sheet-description"
className={cn("text-muted-foreground text-sm", className)}
{...props}
/>
)
}Tabs function · typescript · L9-L26 (18 LOC)src/components/ui/tabs.tsx
function Tabs({
className,
orientation = "horizontal",
...props
}: React.ComponentProps<typeof TabsPrimitive.Root>) {
return (
<TabsPrimitive.Root
data-slot="tabs"
data-orientation={orientation}
orientation={orientation}
className={cn(
"group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",
className
)}
{...props}
/>
)
}TabsList function · typescript · L43-L57 (15 LOC)src/components/ui/tabs.tsx
function TabsList({
className,
variant = "default",
...props
}: React.ComponentProps<typeof TabsPrimitive.List> &
VariantProps<typeof tabsListVariants>) {
return (
<TabsPrimitive.List
data-slot="tabs-list"
data-variant={variant}
className={cn(tabsListVariants({ variant }), className)}
{...props}
/>
)
}TabsTrigger function · typescript · L59-L76 (18 LOC)src/components/ui/tabs.tsx
function TabsTrigger({
className,
...props
}: React.ComponentProps<typeof TabsPrimitive.Trigger>) {
return (
<TabsPrimitive.Trigger
data-slot="tabs-trigger"
className={cn(
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
"group-data-[TabsContent function · typescript · L78-L89 (12 LOC)src/components/ui/tabs.tsx
function TabsContent({
className,
...props
}: React.ComponentProps<typeof TabsPrimitive.Content>) {
return (
<TabsPrimitive.Content
data-slot="tabs-content"
className={cn("flex-1 outline-none", className)}
{...props}
/>
)
}Textarea function · typescript · L5-L16 (12 LOC)src/components/ui/textarea.tsx
function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
return (
<textarea
data-slot="textarea"
className={cn(
"border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
className
)}
{...props}
/>
)
}getAnthropicClient function · typescript · L5-L10 (6 LOC)src/lib/ai/anthropic.ts
export function getAnthropicClient() {
if (!client) {
client = new Anthropic();
}
return client;
}If a scraper extracted this row, it came from Repobility (https://repobility.com)
grantSummaryPrompt function · typescript · L3-L27 (25 LOC)src/lib/ai/prompts.ts
export function grantSummaryPrompt(grant: Grant) {
return {
system: `You are a grant analyst helping nonprofits and public agencies understand funding opportunities. Summarize grants in clear, plain English. Be concise and actionable.`,
user: `Summarize this grant opportunity in plain English. Focus on what the grant funds, who it's for, and what makes a strong applicant.
GRANT TITLE: ${grant.title}
AGENCY: ${grant.agency}
FUNDING: $${grant.amount_min?.toLocaleString()} – $${grant.amount_max?.toLocaleString()}
DEADLINE: ${grant.deadline}
DESCRIPTION:
${grant.description}
ELIGIBILITY:
${grant.eligibility_raw}
Respond with JSON in this exact format:
{
"summary": "2-3 sentence plain English summary",
"key_requirements": ["requirement 1", "requirement 2", ...],
"ideal_applicant": "1 sentence describing the ideal applicant",
"tips": ["tip 1", "tip 2"]
}`,
};
}eligibilityExtractionPrompt function · typescript · L29-L50 (22 LOC)src/lib/ai/prompts.ts
export function eligibilityExtractionPrompt(grant: Grant) {
return {
system: `You are a grant eligibility specialist. Extract and structure eligibility criteria from grant descriptions. Be precise and thorough.`,
user: `Extract the structured eligibility criteria from this grant.
GRANT: ${grant.title}
AGENCY: ${grant.agency}
ELIGIBILITY TEXT:
${grant.eligibility_raw}
Respond with JSON in this exact format:
{
"org_types": ["list of eligible organization types"],
"requirements": ["specific requirement 1", "specific requirement 2", ...],
"disqualifiers": ["what would disqualify an applicant"],
"preferred": ["preferred but not required qualifications"],
"min_budget": null or number,
"geographic": "geographic restrictions or null"
}`,
};
}fitScoringPrompt function · typescript · L52-L82 (31 LOC)src/lib/ai/prompts.ts
export function fitScoringPrompt(org: Organization, grant: Grant) {
return {
system: `You are a grant matching specialist. Score how well an organization fits a grant opportunity. Be honest and specific about both strengths and gaps.`,
user: `Score how well this organization matches this grant opportunity.
ORGANIZATION:
- Name: ${org.name}
- Type: ${org.type}
- Mission: ${org.mission}
- Location: ${org.location}
- Annual Budget: $${org.annual_budget?.toLocaleString()}
- Focus Areas: ${org.focus_areas.join(", ")}
GRANT:
- Title: ${grant.title}
- Agency: ${grant.agency}
- Funding: $${grant.amount_min?.toLocaleString()} – $${grant.amount_max?.toLocaleString()}
- Categories: ${grant.category.join(", ")}
ELIGIBILITY:
${grant.eligibility_raw}
Respond with JSON in this exact format:
{
"fit_score": <number 0-100>,
"strengths": ["why this org is a good fit"],
"gaps": ["potential concerns or missing qualifications"],
"recommendation": "1-2 sentence recommendation on whetherproposalSectionPrompt function · typescript · L84-L116 (33 LOC)src/lib/ai/prompts.ts
export function proposalSectionPrompt(
org: Organization,
grant: Grant,
sectionName: string,
sectionDescription: string,
existingContent?: string
) {
return {
system: `You are an expert grant writer who helps nonprofits and public agencies write winning proposals. Write in a professional but accessible style. Be specific, use data when available, and align the proposal with the grant's priorities.`,
user: `Write the "${sectionName}" section of a grant proposal.
ORGANIZATION:
- Name: ${org.name}
- Type: ${org.type}
- Mission: ${org.mission}
- Location: ${org.location}
- Annual Budget: $${org.annual_budget?.toLocaleString()}
- Focus Areas: ${org.focus_areas.join(", ")}
GRANT:
- Title: ${grant.title}
- Agency: ${grant.agency}
- Funding: $${grant.amount_min?.toLocaleString()} – $${grant.amount_max?.toLocaleString()}
- Description: ${grant.description}
- Eligibility: ${grant.eligibility_raw}
SECTION TO WRITE: ${sectionName}
SECTION DESCRIPTION: ${sectionDescription}
$createClient function · typescript · L3-L8 (6 LOC)src/lib/supabase/client.ts
export function createClient() {
return createBrowserClient(
process.env.NEXT_PUBLIC_SUPABASE_URL!,
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!
);
}updateSession function · typescript · L4-L47 (44 LOC)src/lib/supabase/middleware.ts
export async function updateSession(request: NextRequest) {
let supabaseResponse = NextResponse.next({
request,
});
const supabase = createServerClient(
process.env.NEXT_PUBLIC_SUPABASE_URL!,
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
{
cookies: {
getAll() {
return request.cookies.getAll();
},
setAll(cookiesToSet) {
cookiesToSet.forEach(({ name, value }) =>
request.cookies.set(name, value)
);
supabaseResponse = NextResponse.next({
request,
});
cookiesToSet.forEach(({ name, value, options }) =>
supabaseResponse.cookies.set(name, value, options)
);
},
},
}
);
const {
data: { user },
} = await supabase.auth.getUser();
// Redirect unauthenticated users to login (except public routes)
const publicRoutes = ["/", "/login", "/signup"];
const isPublicRoute = publicRoutes.includes(request.nextUrl.pathnacreateClient function · typescript · L4-L28 (25 LOC)src/lib/supabase/server.ts
export async function createClient() {
const cookieStore = await cookies();
return createServerClient(
process.env.NEXT_PUBLIC_SUPABASE_URL!,
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
{
cookies: {
getAll() {
return cookieStore.getAll();
},
setAll(cookiesToSet) {
try {
cookiesToSet.forEach(({ name, value, options }) =>
cookieStore.set(name, value, options)
);
} catch {
// The `setAll` method was called from a Server Component.
// This can be ignored if you have middleware refreshing sessions.
}
},
},
}
);
}cn function · typescript · L4-L6 (3 LOC)src/lib/utils.ts
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}All rows above produced by Repobility · https://repobility.com
middleware function · typescript · L4-L6 (3 LOC)src/middleware.ts
export async function middleware(request: NextRequest) {
return await updateSession(request);
}‹ prevpage 3 / 3